]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls-cli: fix --benchmark-ciphers type overflow
authorAndreas Metzler <ametzler@bebt.de>
Sat, 23 Feb 2019 17:43:49 +0000 (18:43 +0100)
committerAndreas Metzler <ametzler@bebt.de>
Sun, 24 Feb 2019 15:28:54 +0000 (16:28 +0100)
Signed-off-by: Andreas Metzler <ametzler@bebt.de>
src/benchmark.c
src/benchmark.h

index bcc12a903798e1904f60160ebf0f88d70f8b81cc..d6b7cbaf9161c05d67a81643542ecde31ea0df2a 100644 (file)
@@ -47,7 +47,7 @@ static void alarm_handler(int signo)
 #endif
 
 static void
-value2human(unsigned long bytes, double time, double *data, double *speed,
+value2human(uint64_t bytes, double time, double *data, double *speed,
            char *metric)
 {
        if (bytes > 1000 && bytes < 1000 * 1000) {
index a59e088e29f9d1b497209fd5bb2ca2ea35fe0357..77ea44eb36726ae621183d19dac03bdec43acb9f 100644 (file)
@@ -24,6 +24,9 @@
 #include <windows.h>
 #endif
 
+/* for uint64_t */
+# include <stdint.h>
+
 #if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID)
 #undef gettime
 #define gettime(x) clock_gettime(CLOCK_PROCESS_CPUTIME_ID, x)
@@ -44,7 +47,7 @@ void benchmark_tls(int debug_level, int ciphers);
 
 struct benchmark_st {
        struct timespec start;
-       unsigned long size;
+       uint64_t size;
        sighandler_t old_handler;
 #if defined(_WIN32)
        HANDLE wtimer;