Преглед изворни кода

entropy: Use POSIX types for format specifiers

Aaron Marcher пре 7 година
родитељ
комит
b65c058598
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      components/entropy.c

+ 3 - 3
components/entropy.c

@@ -1,7 +1,7 @@
 /* See LICENSE file for copyright and license details. */
 /* See LICENSE file for copyright and license details. */
 #if defined(__linux__)
 #if defined(__linux__)
+	#include <inttypes.h>
 	#include <stdio.h>
 	#include <stdio.h>
-	#include <stdint.h>
 
 
 	#include "../util.h"
 	#include "../util.h"
 
 
@@ -11,11 +11,11 @@
 		uint64_t num;
 		uint64_t num;
 
 
 		if (pscanf("/proc/sys/kernel/random/entropy_avail",
 		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__)
 #elif defined(__OpenBSD__)
 	const char *
 	const char *