0 initialize strings
Otherwise bad things happen when you strcat into them. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e522dd1a68
commit
43023fa519
2
linux.c
2
linux.c
@ -86,7 +86,7 @@ const char *system_default_filename(void)
|
||||
const char *user = getenv("LOGNAME");
|
||||
if (same_string(user, ""))
|
||||
user = "username";
|
||||
filename = malloc(strlen(user) + 5);
|
||||
filename = calloc(strlen(user) + 5, 1);
|
||||
strcat(filename, user);
|
||||
strcat(filename, ".xml");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user