]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD/DEBUG: hpack-tbl: fix format string in standalone debug code
authorWilly Tarreau <w@1wt.eu>
Tue, 12 Apr 2022 06:30:08 +0000 (08:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 12 Apr 2022 06:30:08 +0000 (08:30 +0200)
In issue #1184, cppcheck reports that an incorrect format "%d" was
used to print an unsigned in the debug code, though values are always
very small and this will never be an issue.

src/hpack-tbl.c

index 8df10319a8a74bb3654a4dad0a2bf0490b331b6a..990d2f7ddf9346ecf5bbbbdd1ed51d9c837e3ec7 100644 (file)
@@ -111,7 +111,7 @@ void hpack_dht_dump(FILE *out, const struct hpack_dht *dht)
 
        for (i = HPACK_SHT_SIZE; i < HPACK_SHT_SIZE + dht->used; i++) {
                slot = (hpack_get_dte(dht, i - HPACK_SHT_SIZE + 1) - dht->dte);
-               fprintf(out, "idx=%d slot=%u name=<%s> value=<%s> addr=%u-%u\n",
+               fprintf(out, "idx=%u slot=%u name=<%s> value=<%s> addr=%u-%u\n",
                        i, slot,
                        istpad(name, hpack_idx_to_name(dht, i)).ptr,
                        istpad(value, hpack_idx_to_value(dht, i)).ptr,