summaryrefslogtreecommitdiff
path: root/components/entropy.c
diff options
context:
space:
mode:
authordrkhsh <me@drkhsh.at>2022-10-27 23:44:52 +0200
committerdrkhsh <me@drkhsh.at>2022-10-28 01:01:10 +0200
commit69b2487650782f135db76078c4a7fb841cb936ac (patch)
treee236b6b8503587b9263f45e775204a64463c5ca3 /components/entropy.c
parentc46c1487a986496dd813ec52e17e5bf9ba10fd84 (diff)
downloadslstatus-69b2487650782f135db76078c4a7fb841cb936ac.tar.gz
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.c6
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);
}