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.
This commit is contained in:
drkhsh
2022-10-27 23:44:52 +02:00
parent c46c1487a9
commit 69b2487650
5 changed files with 36 additions and 41 deletions

View File

@ -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);
}