]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Lose an unused variable in print-snmp.c.
authorDenis Ovsienko <[email protected]>
Sun, 18 Dec 2022 21:38:58 +0000 (21:38 +0000)
committerDenis Ovsienko <[email protected]>
Sat, 31 Dec 2022 16:31:00 +0000 (16:31 +0000)
./print-snmp.c:1200:17: warning: variable 'ind' set but not used
  [-Wunused-but-set-variable]

clang version 15.0.1
Target: aarch64-portbld-freebsd13.1

(cherry picked from commit eaaa2f168ae11c9de618484c373c1e06be37781a)

print-snmp.c

index a38fee2e4f25970a7035553a2918f67c5e5e78ef..6aae34caa7de1b90ab54557e30feb66c7cd90bcf 100644 (file)
@@ -1217,7 +1217,7 @@ varbind_print(netdissect_options *ndo,
               u_short pduid, const u_char *np, u_int length)
 {
        struct be elem;
-       int count = 0, ind;
+       int count = 0;
 #ifdef USE_LIBSMI
        SmiNode *smiNode = NULL;
 #endif
@@ -1237,7 +1237,7 @@ varbind_print(netdissect_options *ndo,
        length = elem.asnlen;
        np = (const u_char *)elem.data.raw;
 
-       for (ind = 1; length > 0; ind++) {
+       while (length) {
                const u_char *vbend;
                u_int vblength;