summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaslo Hunhold <dev@frign.de>2018-05-20 00:18:08 +0200
committerAaron Marcher <me@drkhsh.at>2018-05-20 00:19:52 +0200
commit951ea4e304cf23f8464a4b6896cfcf4035920249 (patch)
treec38cf19fd3c7ee3c18088f01377968932836aa2a
parent3f45a5f7caf37ec04bbc3aea5e7def1452d1118c (diff)
Refactor entropy.c
-rw-r--r--components/entropy.c9
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 *