mirror of https://github.com/mgba-emu/mgba.git
VFS: Fix separatePath for the root directory
This commit is contained in:
parent
d945391da6
commit
341ebd0435
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue