diff options
-rw-r--r-- | components/entropy.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/components/entropy.c b/components/entropy.c index ac61679..606bfec 100644 --- a/components/entropy.c +++ b/components/entropy.c @@ -9,9 +9,12 @@ { 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 * |