Browse Source

fixed run_command()

master
Aaron Marcher 7 years ago
parent
commit
5a70f920f0
No known key found for this signature in database GPG Key ID: 74B048E5C2474F9A
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      slstatus.c

+ 2
- 2
slstatus.c View File

@@ -407,8 +407,8 @@ run_command(const char *cmd)
warn("Failed to get command output for %s", cmd);
return smprintf(UNKNOWN_STR);
}
fgets(buf, sizeof(buf), fp);
buf[sizeof(buf)-1] = '\0';
fgets(buf, sizeof(buf)-1, fp);
buf[strlen(buf)-1] = '\0';
pclose(fp);

return smprintf("%s", buf);


Loading…
Cancel
Save