projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f62d626
)
strtok() has no effect on buf && fgets() should have the full buffer length
author
raiz
<raiz@firemail.cc>
Tue, 27 Dec 2016 15:54:16 +0000
(18:54 +0300)
committer
raiz
<raiz@firemail.cc>
Tue, 27 Dec 2016 15:54:16 +0000
(18:54 +0300)
slstatus.c
patch
|
blob
|
history
diff --git
a/slstatus.c
b/slstatus.c
index 21cda513ad79b20266cb73f9cb12bde589c57a53..73e0f2c9b22186cdcf20744162cd009ca3bd530f 100644
(file)
--- 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);
}