]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix cppcheck 1.90 warning
authorMichał Kępień <michal@isc.org>
Wed, 4 Mar 2020 11:41:01 +0000 (12:41 +0100)
committerMichał Kępień <michal@isc.org>
Wed, 4 Mar 2020 11:41:01 +0000 (12:41 +0100)
cppcheck 1.90 reports the following issue for bin/named/query.c:

    bin/named/query.c:6838:2: warning: %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
     snprintf(mbuf, sizeof(mbuf) - 1,
     ^

Tweak the format specifier for client->query.restarts to address the
problem.

bin/named/query.c

index fd80cff124a75d9ff892af8b624a1d105c5a9d7e..203f1e611a73e180f5addb79c860f4f6cbb9f93d 100644 (file)
@@ -6836,7 +6836,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
                snprintf(qbuf, sizeof(qbuf), "<unset>");
 
        snprintf(mbuf, sizeof(mbuf) - 1,
-                "client attr:0x%x, query attr:0x%X, restarts:%d, "
+                "client attr:0x%x, query attr:0x%X, restarts:%u, "
                 "origqname:%s, timer:%d, authdb:%d, referral:%d",
                 client->attributes,
                 client->query.attributes,