diff options
author | Laslo Hunhold <dev@frign.de> | 2018-05-20 00:18:08 +0200 |
---|---|---|
committer | Aaron Marcher <me@drkhsh.at> | 2018-05-20 00:19:52 +0200 |
commit | 951ea4e304cf23f8464a4b6896cfcf4035920249 (patch) | |
tree | c38cf19fd3c7ee3c18088f01377968932836aa2a /components | |
parent | 3f45a5f7caf37ec04bbc3aea5e7def1452d1118c (diff) |
Refactor entropy.c
Diffstat (limited to 'components')
-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 * |