]> The Tcpdump Group git mirrors - libpcap/commitdiff
Use "%d" to print a signed int
authorFrancois-Xavier Le Bail <[email protected]>
Tue, 1 Mar 2022 21:32:43 +0000 (22:32 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 2 Mar 2022 12:02:18 +0000 (13:02 +0100)
Fix this cppcheck warning:
rpcapd/daemon.c:2349:3: warning: %u in format string (no. 1) requires
'unsigned int' but the argument type is 'signed int'.
[invalidPrintfArgType_uint]
  snprintf(errmsgbuf, PCAP_ERRBUF_SIZE,
  ^

(cherry picked from commit 8d6bef98827b9d02198ade6fd94d9f42ed302889)

rpcapd/daemon.c

index 0742700dc865c1a89d134e0d174340c218ae4310..362f4b9bb060f5c6548d305ab4fe89a9f97cfa27 100644 (file)
@@ -2347,7 +2347,7 @@ daemon_unpackapplyfilter(SOCKET sockctrl, SSL *ctrl_ssl, struct session *session
        if (bf_prog.bf_len > RPCAP_BPF_MAXINSNS)
        {
                snprintf(errmsgbuf, PCAP_ERRBUF_SIZE,
-                   "Filter program is larger than the maximum size of %u instructions",
+                   "Filter program is larger than the maximum size of %d instructions",
                    RPCAP_BPF_MAXINSNS);
                return -2;
        }