1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-05 20:16:44 +02:00

Fix various video bugs; it should be working now!

This commit is contained in:
Jfreegman
2015-11-12 05:01:28 -05:00
parent d16be574f3
commit 05f5f16af3
8 changed files with 109 additions and 83 deletions

View File

@ -282,12 +282,15 @@ size_t get_file_name(char *namebuf, size_t bufsize, const char *pathname)
}
/* Gets the base directory of path and puts it in dir.
* dir must have at least as much space as path_len.
* dir must have at least as much space as path_len + 1.
*
* Returns the length of the base directory.
*/
size_t get_base_dir(const char *path, size_t path_len, char *dir)
{
if (path_len == 0 || path == NULL)
return 0;
size_t dir_len = char_rfind(path, '/', path_len);
if (dir_len != 0 && dir_len < path_len)