mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-02 22:25:48 +01:00
Fix possible missing NUL at end of string
There are were a few uses of 'strncpy' that could lead to a missing NUL, resulting in possible garbage being displayed. As suggested by Tamas, use 'wstrlcpy' instead
This commit is contained in:
committed by
Carlos R. Mafra
parent
e499f31a4e
commit
e01d14abe4
@@ -3400,9 +3400,8 @@ char *generateNewFilename(char *curName)
|
||||
|
||||
newName = wmalloc(baseLen + 16);
|
||||
strncpy(newName, curName, baseLen);
|
||||
newName[baseLen] = 0;
|
||||
|
||||
sprintf(&newName[baseLen], " {%i}", n + 1);
|
||||
snprintf(&newName[baseLen], 16, " {%i}", n + 1);
|
||||
|
||||
return newName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user