VFS: Fix separatePath for the root directory
Jeffrey Pfau jeffrey@endrift.com
Sun, 03 Jan 2016 11:07:35 -0800
1 files changed,
2 insertions(+),
0 deletions(-)
jump to
M
src/util/vfs.c
→
src/util/vfs.c
@@ -168,6 +168,8 @@ if (dirname) {
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';