misc: fix some printf format strings

Noticed on xcode/OSX.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This commit is contained in:
Ruediger Meier 2017-08-16 14:50:57 +02:00
parent fcd90d9ac7
commit e282116f6d
1 changed files with 4 additions and 2 deletions

View File

@ -192,6 +192,8 @@ const char *random_tell_source(void)
} }
#ifdef TEST_PROGRAM_RANDUTILS #ifdef TEST_PROGRAM_RANDUTILS
#include <inttypes.h>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
size_t i, n; size_t i, n;
@ -204,7 +206,7 @@ int main(int argc, char *argv[])
printf("Multiple random calls:\n"); printf("Multiple random calls:\n");
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
random_get_bytes(&v, sizeof(v)); random_get_bytes(&v, sizeof(v));
printf("#%02zu: %25ju\n", i, v); printf("#%02zu: %25"PRIu64"\n", i, v);
} }
@ -217,7 +219,7 @@ int main(int argc, char *argv[])
random_get_bytes(buf, bufsz); random_get_bytes(buf, bufsz);
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
vp = (int64_t *) (buf + (i * sizeof(*vp))); vp = (int64_t *) (buf + (i * sizeof(*vp)));
printf("#%02zu: %25ju\n", i, *vp); printf("#%02zu: %25"PRIu64"\n", i, *vp);
} }
return EXIT_SUCCESS; return EXIT_SUCCESS;