From 3bfc3bbcae41c58cc527ee074468afc83ef1a9ab Mon Sep 17 00:00:00 2001 From: raiz Date: Tue, 27 Dec 2016 18:54:16 +0300 Subject: strtok() has no effect on buf && fgets() should have the full buffer length --- slstatus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'slstatus.c') diff --git a/slstatus.c b/slstatus.c index 21cda51..73e0f2c 100644 --- a/slstatus.c +++ b/slstatus.c @@ -413,11 +413,10 @@ run_command(const char *cmd) 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); } -- cgit v1.2.3