]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Don't do ++ inside the argument to EXTRACT_8BITS().
authorGuy Harris <[email protected]>
Sun, 19 Nov 2017 19:49:04 +0000 (11:49 -0800)
committerGuy Harris <[email protected]>
Sun, 19 Nov 2017 19:49:04 +0000 (11:49 -0800)
The code's a bit cleaner - you can't use it with the other EXTRACT
macros, because they use the argument more than once, so this makes the
style consistent - and that protects it in case the argument ever *is*
used more than once in the macro (unlikely, but...).

print-babel.c
print-isoclns.c

index ad30ee00aa4148571a3b6a50db8a525461d11e9a..ae113adb1e0ea8513ec4853d56d522ea9c1297b6 100644 (file)
@@ -298,7 +298,8 @@ subtlvs_print(netdissect_options *ndo,
             }
             sep = " ";
             while(sublen--) {
-                ND_PRINT((ndo, "%s%s", sep, tok2str(diversity_str, "%u", EXTRACT_8BITS(cp++))));
+                ND_PRINT((ndo, "%s%s", sep, tok2str(diversity_str, "%u", EXTRACT_8BITS(cp))));
+                cp++;
                 sep = "-";
             }
             if(tlv_type != MESSAGE_UPDATE &&
index d7d9e369e67b8c3f07f44dee27799bc83b73053e..d4d04008b8388901b51165cc4a4cd1c07ad09f73 100644 (file)
@@ -2653,7 +2653,8 @@ isis_print(netdissect_options *ndo,
             ND_PRINT((ndo, "\n\t      %s",
                    tok2str(isis_is_reach_virtual_values,
                            "bogus virtual flag 0x%02x",
-                           EXTRACT_8BITS(tptr++))));
+                           EXTRACT_8BITS(tptr))));
+           tptr++;
            tlv_is_reach = (const struct isis_tlv_is_reach *)tptr;
             while (tmp >= sizeof(struct isis_tlv_is_reach)) {
                ND_TCHECK(*tlv_is_reach);
@@ -2902,7 +2903,8 @@ isis_print(netdissect_options *ndo,
            if (tmp < 1)
                break;
            ND_TCHECK2(*tptr, 1);
-           ND_PRINT((ndo, ", Flags: [%s]", ISIS_MASK_TLV_SHARED_RISK_GROUP(EXTRACT_8BITS(tptr++)) ? "numbered" : "unnumbered"));
+           ND_PRINT((ndo, ", Flags: [%s]", ISIS_MASK_TLV_SHARED_RISK_GROUP(EXTRACT_8BITS(tptr)) ? "numbered" : "unnumbered"));
+           tptr++;
            tmp--;
 
            if (tmp < sizeof(struct in_addr))