run_command: strlen() will not function if string is not null terminated
Aaron Marcher info@nulltime.net
Sat, 07 Jan 2017 21:19:40 +0100
1 files changed,
1 insertions(+),
1 deletions(-)
jump to
M
slstatus.c
→
slstatus.c
@@ -426,7 +426,7 @@ return smprintf("%s", UNKNOWN_STR);
} fgets(buf, sizeof(buf), fp); pclose(fp); - buf[strlen(buf)] = '\0'; + buf[sizeof(buf)] = '\0'; if ((nlptr = strstr(buf, "\n")) != NULL) { nlptr[0] = '\0';