strtok() has no effect on buf && fgets() should have the full buffer length
raiz raiz@firemail.cc
Tue, 27 Dec 2016 18:54:16 +0300
1 files changed,
1 insertions(+),
2 deletions(-)
jump to
M
slstatus.c
→
slstatus.c
@@ -413,11 +413,10 @@ if (fp == NULL) {
warn("Failed to get command output for %s", cmd); return smprintf(UNKNOWN_STR); } - fgets(buf, sizeof(buf)-1, fp); + fgets(buf, sizeof(buf), fp); pclose(fp); buf[strlen(buf)] = '\0'; - strtok(buf, "\n"); return smprintf("%s", buf); }