VFS: Fix separatePath for the root directory

This commit is contained in:
Jeffrey Pfau 2016-01-03 11:07:35 -08:00
parent d945391da6
commit 341ebd0435
1 changed files with 2 additions and 0 deletions

View File

@ -168,6 +168,8 @@ void separatePath(const char* path, char* dirname, char* basename, char* extensi
ptrdiff_t len = separatorPoint - path;
if (PATH_MAX <= len) {
len = PATH_MAX - 1;
} else if (!len) {
len = 1;
}
strncpy(dirname, path, len);
dirname[len] = '\0';