all repos — slstatus @ 6890a27a3a4b0ac5f57d1fe554db0dbb90909072

my build of slstatus (tools.suckless.org/slstatus/)

fixed run_command()
Aaron Marcher info@nulltime.net
Mon, 10 Oct 2016 09:19:44 +0200
commit

6890a27a3a4b0ac5f57d1fe554db0dbb90909072

parent

5a70f920f04f1bfc2df959d2ae131f511b7c8e38

1 files changed, 4 insertions(+), 2 deletions(-)

jump to
M slstatus.cslstatus.c

@@ -400,7 +400,7 @@ static char *

run_command(const char *cmd) { FILE *fp; - char buf[64] = "n/a"; + char buf[1024] = "n/a"; fp = popen(cmd, "r"); if (fp == NULL) {

@@ -408,8 +408,10 @@ warn("Failed to get command output for %s", cmd);

return smprintf(UNKNOWN_STR); } fgets(buf, sizeof(buf)-1, fp); - buf[strlen(buf)-1] = '\0'; pclose(fp); + + buf[strlen(buf)] = '\0'; + strtok(buf, "\n"); return smprintf("%s", buf); }