commit 3bfc3bbcae41c58cc527ee074468afc83ef1a9ab
parent f62d626d9b7958362fcf3605bcd2280295c0a30c
Author: raiz <[email protected]>
Date:   Tue, 27 Dec 2016 18:54:16 +0300
strtok() has no effect on buf && fgets() should have the full buffer length
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git 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);
 }