From: Francois-Xavier Le Bail Date: Tue, 1 Mar 2022 21:32:43 +0000 (+0100) Subject: Use "%d" to print a signed int X-Git-Tag: libpcap-1.10.2~230 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/036c9eec372714351d8fcf13b401175663512740 Use "%d" to print a signed int 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) --- diff --git a/rpcapd/daemon.c b/rpcapd/daemon.c index 0742700d..362f4b9b 100644 --- a/rpcapd/daemon.c +++ b/rpcapd/daemon.c @@ -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; }