Avoid last ret char not being zero after strncpy

This commit is contained in:
Clément Bœsch 2011-02-23 20:56:09 +01:00
parent f5134bd6b3
commit d79404f5ee

View File

@ -360,7 +360,7 @@ patht(char *path)
return NULL;
strncpy(ret, path, sizeof(ret));
ret[sizeof(ret) - 1] = 0;
if(strstr(path, "~/"))
sprintf(ret, "%s/%s", getenv("HOME"), path + 2);