X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=os%2Fwindows%2Fposix.c;h=00f03355985077c08665a79e5036b60755507e40;hp=488d0ed2c44e16bd1bd82c447b9affb67e567987;hb=13a85be93769986e03662e8dae6f8bfdf2971aa9;hpb=ba8b89a1549c5ce7d7544813c9137798de454fac diff --git a/os/windows/posix.c b/os/windows/posix.c index 488d0ed2..00f03355 100755 --- a/os/windows/posix.c +++ b/os/windows/posix.c @@ -584,7 +584,8 @@ char *basename(char *path) while (path[i] != '\\' && path[i] != '/' && i >= 0) i--; - strncpy(name, path + i + 1, MAX_PATH); + name[MAX_PATH - 1] = '\0'; + strncpy(name, path + i + 1, MAX_PATH - 1); return name; }