xwin: fix possibly missing string termination
../hw/xwin/InitOutput.c: In function ‘winFixupPaths’: 747../hw/xwin/InitOutput.c:578:9: warning: ‘strncpy’ output truncated before terminating nul copying 5 bytes from a string of the same length [-Wstringop-truncation] 748 578 | strncpy(buffer, "HOME=", 5); 749 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1295>
This commit is contained in:
parent
f855e35df2
commit
123a473e33
|
@ -577,9 +577,9 @@ winFixupPaths(void)
|
|||
putenv(buffer);
|
||||
}
|
||||
if (getenv("HOME") == NULL) {
|
||||
char buffer[MAX_PATH + 5];
|
||||
char buffer[MAX_PATH + 5] = {0};
|
||||
|
||||
strncpy(buffer, "HOME=", 5);
|
||||
strncpy(buffer, "HOME=", 6);
|
||||
|
||||
/* query appdata directory */
|
||||
if (SHGetFolderPathA
|
||||
|
|
Loading…
Reference in New Issue