diff options
author | raiz <raiz@firemail.cc> | 2016-12-27 18:54:16 +0300 |
---|---|---|
committer | raiz <raiz@firemail.cc> | 2016-12-27 18:54:16 +0300 |
commit | 3bfc3bbcae41c58cc527ee074468afc83ef1a9ab (patch) | |
tree | e0192d16ed4a7ce74e5f31091bb3c9232a8ba73d /slstatus.c | |
parent | f62d626d9b7958362fcf3605bcd2280295c0a30c (diff) |
strtok() has no effect on buf && fgets() should have the full buffer length
Diffstat (limited to 'slstatus.c')
-rw-r--r-- | slstatus.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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); } |