summaryrefslogtreecommitdiff
path: root/src/certtool-cfg.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2015-03-05 18:59:25 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2015-03-05 19:00:41 +0100
commitee9ab6d702c1f496c6ab077ddfbed906f5969cd3 (patch)
tree1deb020d4757eedd3bd48882bc7d26c4827187b7 /src/certtool-cfg.c
parent3a26b1a35e336c0ec4f390713057f7cb0f21b73f (diff)
downloadgnutls-ee9ab6d702c1f496c6ab077ddfbed906f5969cd3.tar.gz
certtool: in 32-bit systems use PRIu64 to print 64-bit values
Diffstat (limited to 'src/certtool-cfg.c')
-rw-r--r--src/certtool-cfg.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/certtool-cfg.c b/src/certtool-cfg.c
index 332b8b2e96..57ca2cc766 100644
--- a/src/certtool-cfg.c
+++ b/src/certtool-cfg.c
@@ -52,6 +52,12 @@
#include <getpass.h>
#include "certtool-common.h"
+/* to print uint64_t */
+#if SIZEOF_LONG < 8
+# define __STDC_FORMAT_MACROS
+# include <inttypes.h>
+#endif
+
extern int batch;
extern int ask_pass;
@@ -1137,10 +1143,11 @@ void get_rand_int_value(unsigned char* serial, size_t * size, int64_t cfg_val, c
#if SIZEOF_LONG < 8
default_serial_int = ts.tv_sec;
+ snprintf(tmsg, sizeof(tmsg), "%s (default: %" PRIu64"): ", msg, default_serial_int);
#else
default_serial_int = (ts.tv_sec << 32) | ts.tv_nsec;
-#endif
snprintf(tmsg, sizeof(tmsg), "%s (default: %lu): ", msg, default_serial_int);
+#endif
default_serial_int = read_int_with_default(tmsg, (long)default_serial_int);
default_serial[0] = default_serial_int >> 32;