Avoid last ret char not being zero after strncpy
This commit is contained in:
parent
f5134bd6b3
commit
d79404f5ee
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user