]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Fix 2 compiler warnings 930/head
authorVictor Julien <victor@inliniac.net>
Sun, 13 Apr 2014 08:35:36 +0000 (10:35 +0200)
committerVictor Julien <victor@inliniac.net>
Sun, 13 Apr 2014 08:35:36 +0000 (10:35 +0200)
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
src/log-tlslog.c

index cc7f86479f2ede01073a88032ebdb9772a045dba..12c2196b582a5f8dd9fcdda348a951914d35139e 100644 (file)
@@ -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;
 
index 0adf7f9ce52c6c6a6d528d0710b4674eb0247dbc..64959991b502172a255d87bf312f48d63f3cc238 100644 (file)
@@ -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;