all repos — slstatus @ 35295f190207d9001fdcf30fe76f11434691b259

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

On success, fgets always terminates the result.

If fgets succeeds, then the resulting char array is always
terminated by a '\0'. No need to keep extra space, therefore
sizeof(buf) is the correct argument.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann tobias@stoeckmann.org
Tue, 04 Apr 2017 21:27:31 +0200
commit

35295f190207d9001fdcf30fe76f11434691b259

parent

1289bdb742adab134cf4874447b66ab386deb724

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

jump to
M slstatus.cslstatus.c

@@ -447,7 +447,7 @@ if (fp == NULL) {

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';