projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f45a5f
)
Refactor entropy.c
author
Laslo Hunhold
<dev@frign.de>
Sat, 19 May 2018 22:18:08 +0000
(
00:18
+0200)
committer
Aaron Marcher
<me@drkhsh.at>
Sat, 19 May 2018 22:19:52 +0000
(
00:19
+0200)
components/entropy.c
patch
|
blob
|
history
diff --git
a/components/entropy.c
b/components/entropy.c
index ac61679af3fe9b89e931cc1ea07fa81fa4a94ac0..606bfecd295a47a679d7994b18e9bf30be718595 100644
(file)
--- a/
components/entropy.c
+++ b/
components/entropy.c
@@
-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 *