Refactor entropy.c

This commit is contained in:
Laslo Hunhold 2018-05-20 00:18:08 +02:00 committed by Aaron Marcher
parent 3f45a5f7ca
commit 951ea4e304
1 changed files with 6 additions and 3 deletions

View File

@ -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 *