From: Guy Harris Date: Tue, 8 Jul 2014 10:26:18 +0000 (-0700) Subject: Clean up the first-item handling a bit. X-Git-Tag: tcpdump-4.6.1~6 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/237acb8f896a20821c6f06b6d422d5034b981fcd Clean up the first-item handling a bit. This makes it look a bit more like the handling of other items. --- diff --git a/print-snmp.c b/print-snmp.c index f38fff70..53bc210a 100644 --- a/print-snmp.c +++ b/print-snmp.c @@ -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;