From 79c924af8ca2a84e35c90dc8807ce5e7e87e1661 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sun, 13 Apr 2014 10:35:36 +0200 Subject: [PATCH] Fix 2 compiler warnings FreeBSD 10 32-bit with clang 3.3: log-tlslog.c:172:14: error: format specifies type 'long' but the argument has type 'time_t' (aka 'int') [-Werror,-Wformat] p->ts.tv_sec, ^~~~~~~~~~~~ 1 error generated. detect-engine-payload.c:508:27: warning: format specifies type 'long' but the argument has type 'time_t' (aka 'int') [-Wformat] printf("%ld.%06ld\n", tv_diff.tv_sec, (long int)tv_diff.tv_usec); ~~~ ^~~~~~~~~~~~~~ %d 1 warning generated. --- src/detect-engine-payload.c | 2 +- src/log-tlslog.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detect-engine-payload.c b/src/detect-engine-payload.c index cc7f86479f..12c2196b58 100644 --- a/src/detect-engine-payload.c +++ b/src/detect-engine-payload.c @@ -505,7 +505,7 @@ static int PayloadTestSig13(void) tv_diff.tv_sec = tv_end.tv_sec - tv_start.tv_sec; tv_diff.tv_usec = tv_end.tv_usec - tv_start.tv_usec; - printf("%ld.%06ld\n", tv_diff.tv_sec, (long int)tv_diff.tv_usec); + printf("%ld.%06ld\n", (long int)tv_diff.tv_sec, (long int)tv_diff.tv_usec); result = 1; diff --git a/src/log-tlslog.c b/src/log-tlslog.c index 0adf7f9ce5..64959991b5 100644 --- a/src/log-tlslog.c +++ b/src/log-tlslog.c @@ -169,7 +169,7 @@ static int CreateFileName(LogTlsFileCtx *log, const Packet *p, SSLState *state, * On a live device, we will not be able to overwrite */ snprintf(filename, filenamelen, "%s/%ld.%ld-%d.pem", tls_logfile_base_dir, - p->ts.tv_sec, + (long int)p->ts.tv_sec, (long int)p->ts.tv_usec, file_id); return 1; -- 2.47.2