Refactor entropy.c
Laslo Hunhold dev@frign.de
Sun, 20 May 2018 00:18:08 +0200
1 files changed,
6 insertions(+),
3 deletions(-)
jump to
M
components/entropy.c
→
components/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 *