mirror of
git://git.suckless.org/slstatus
synced 2025-03-02 11:30:23 +00:00
Merge pull request #39 from stoeckmann/fgets
On success, fgets always terminates the result.
This commit is contained in:
commit
95ceafcae7
@ -447,7 +447,7 @@ run_command(const char *cmd)
|
||||
warn("Failed to get command output for %s", cmd);
|
||||
return smprintf("%s", UNKNOWN_STR);
|
||||
}
|
||||
fgets(buf, sizeof(buf) - 1, fp);
|
||||
fgets(buf, sizeof(buf), fp);
|
||||
pclose(fp);
|
||||
buf[sizeof(buf) - 1] = '\0';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user