Xinqi Bao's Git

entropy: Use POSIX types for format specifiers
authorAaron Marcher <[email protected]>
Fri, 6 Jul 2018 21:26:12 +0000 (23:26 +0200)
committerAaron Marcher <[email protected]>
Fri, 6 Jul 2018 21:26:12 +0000 (23:26 +0200)
components/entropy.c

index 4ca7110..7f6112e 100644 (file)
@@ -1,7 +1,7 @@
 /* See LICENSE file for copyright and license details. */
 #if defined(__linux__)
 /* See LICENSE file for copyright and license details. */
 #if defined(__linux__)
+       #include <inttypes.h>
        #include <stdio.h>
        #include <stdio.h>
-       #include <stdint.h>
 
        #include "../util.h"
 
 
        #include "../util.h"
 
                uint64_t num;
 
                if (pscanf("/proc/sys/kernel/random/entropy_avail",
                uint64_t num;
 
                if (pscanf("/proc/sys/kernel/random/entropy_avail",
-                          "%d", &num) != 1) {
+                          "%" PRIu64, &num) != 1) {
                        return NULL;
                }
 
                        return NULL;
                }
 
-               return bprintf("%d", num);
+               return bprintf("%" PRIu64, num);
        }
 #elif defined(__OpenBSD__)
        const char *
        }
 #elif defined(__OpenBSD__)
        const char *