all repos — mgba @ 341ebd04356360cfff3e217bf7a419e43b534ef1

mGBA Game Boy Advance Emulator

VFS: Fix separatePath for the root directory
Jeffrey Pfau jeffrey@endrift.com
Sun, 03 Jan 2016 11:07:35 -0800
commit

341ebd04356360cfff3e217bf7a419e43b534ef1

parent

d945391da6f5f0fefa78a561b8f02680402e4d24

1 files changed, 2 insertions(+), 0 deletions(-)

jump to
M src/util/vfs.csrc/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';