]> The Tcpdump Group git mirrors - libpcap/commitdiff
TurboCap: Use "%d" to print a signed int
authorFrancois-Xavier Le Bail <[email protected]>
Tue, 1 Mar 2022 20:52:26 +0000 (21:52 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 2 Mar 2022 12:02:18 +0000 (13:02 +0100)
Fix this cppcheck warning:
pcap-tc.c:1127:3: warning: %u in format string (no. 1) requires
'unsigned int' but the argument type is 'signed int'.
[invalidPrintfArgType_uint]
  snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "Mode %u not supported by TurboCap
  devices. TurboCap only supports capture.", mode);
  ^

(cherry picked from commit 34984c6da3a5b94c64750b313b45aca79b739faf)

pcap-tc.c

index 9902633a933f2d9599109016e215da6c7c77b65e..aa28f0fe4021cb6dfe2baee0dbeb5754296620cb 100644 (file)
--- a/pcap-tc.c
+++ b/pcap-tc.c
@@ -1124,7 +1124,7 @@ TcSetMode(pcap_t *p, int mode)
 {
        if (mode != MODE_CAPT)
        {
-               snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "Mode %u not supported by TurboCap devices. TurboCap only supports capture.", mode);
+               snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "Mode %d not supported by TurboCap devices. TurboCap only supports capture.", mode);
                return -1;
        }