all repos — slstatus @ 951ea4e304cf23f8464a4b6896cfcf4035920249

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

Refactor entropy.c
Laslo Hunhold dev@frign.de
Sun, 20 May 2018 00:18:08 +0200
commit

951ea4e304cf23f8464a4b6896cfcf4035920249

parent

3f45a5f7caf37ec04bbc3aea5e7def1452d1118c

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

jump to
M components/entropy.ccomponents/entropy.c

@@ -9,9 +9,12 @@ entropy(void)

{ int num; - return (pscanf("/proc/sys/kernel/random/entropy_avail", - "%d", &num) == 1) ? - bprintf("%d", num) : NULL; + if (pscanf("/proc/sys/kernel/random/entropy_avail", + "%d", &num) != 1) { + return NULL; + } + + return bprintf("%d", num); } #elif defined(__OpenBSD__) const char *