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:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user