]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Clean up the first-item handling a bit.
authorGuy Harris <[email protected]>
Tue, 8 Jul 2014 10:26:18 +0000 (03:26 -0700)
committerGuy Harris <[email protected]>
Tue, 8 Jul 2014 10:26:43 +0000 (03:26 -0700)
This makes it look a bit more like the handling of other items.

print-snmp.c

index f38fff70ee3aa28135984de0f54d57068a825356..53bc210a367e99d70668e54f92c429623b375c54 100644 (file)
@@ -914,11 +914,10 @@ smi_decode_oid(netdissect_options *ndo,
                        first = 0;
                        firstval = o / OIDMUX;
                        if (firstval > 2) firstval = 2;
+                       o -= firstval * OIDMUX;
                        if (*oidlen < oidsize) {
-                           oid[*oidlen] = firstval;
+                           oid[(*oidlen)++] = firstval;
                        }
-                       o -= firstval * OIDMUX;
-                       if (*oidlen < oidsize) (*oidlen)++;
                }
                if (*oidlen < oidsize) {
                        oid[(*oidlen)++] = o;