summaryrefslogtreecommitdiff
path: root/src/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/random.c')
-rw-r--r--src/random.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/random.c b/src/random.c
index 7574074..fa87cbb 100644
--- a/src/random.c
+++ b/src/random.c
@@ -18,7 +18,7 @@ urandom_bytes(const size_t n, uint8_t (*const addr)[]) {
FILE *f = NULL;
f = fopen("/dev/urandom", "r");
- if (!f) {
+ if (f == NULL) {
logerr("fopen(\"/dev/urandom\", \"r\"): %s\n", strerror(errno));
goto out;
}
@@ -32,7 +32,7 @@ urandom_bytes(const size_t n, uint8_t (*const addr)[]) {
rc = 0;
out:
- if (f) {
+ if (f != NULL) {
if (fclose(f)) {
logerr("fclose(f): %s\n", strerror(errno));
rc = -1;