commit 951ea4e304cf23f8464a4b6896cfcf4035920249 Author: Laslo Hunhold <d...@frign.de> AuthorDate: Sun May 20 00:18:08 2018 +0200 Commit: Aaron Marcher <m...@drkhsh.at> CommitDate: Sun May 20 00:19:52 2018 +0200
Refactor entropy.c 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 *