diff options
author | drkhsh <me@drkhsh.at> | 2022-10-27 23:44:52 +0200 |
---|---|---|
committer | Rafael Marçalo <raroma09@gmail.com> | 2022-10-28 22:21:57 +0100 |
commit | e4d20140ece1a98149ba6def74978e7e90b9c11f (patch) | |
tree | 2cc6d8b4358d78cd1d931c37c8766103c6f00861 /components/entropy.c | |
parent | 1af8f3cebe5048b0e263303bbbcef75ecd236c4a (diff) |
various: Put paths into defines to avoid line wraps
Long, wrapped, multi-line if statements suck to read.
This fixes readability in the worst places by packing format strings for
paths into defines.
Diffstat (limited to 'components/entropy.c')
-rw-r--r-- | components/entropy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/entropy.c b/components/entropy.c index 0544749..66b2e5a 100644 --- a/components/entropy.c +++ b/components/entropy.c @@ -6,15 +6,15 @@ #include "../util.h" + #define ENTROPY_AVAIL "/proc/sys/kernel/random/entropy_avail" + const char * entropy(const char *unused) { uintmax_t num; - if (pscanf("/proc/sys/kernel/random/entropy_avail", "%ju", &num) - != 1) { + if (pscanf(ENTROPY_AVAIL, "%ju", &num) != 1) return NULL; - } return bprintf("%ju", num); } |