From 951ea4e304cf23f8464a4b6896cfcf4035920249 Mon Sep 17 00:00:00 2001 From: Laslo Hunhold Date: Sun, 20 May 2018 00:18:08 +0200 Subject: Refactor entropy.c --- components/entropy.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'components') 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 * -- cgit v1.2.3