]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use more the EXTRACT_U_1() macro (40/n)
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 1 Dec 2017 21:35:28 +0000 (22:35 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 1 Dec 2017 21:35:28 +0000 (22:35 +0100)
In some macros and functions calls.
p[n], unsigned char *p.

print-isakmp.c
smbutil.c

index 31af3f21ae537b592c4ba0530e548f8ce52d4e45..fa9fa23978c6375d149c8cd00c21441e745a2b11 100644 (file)
@@ -2262,7 +2262,7 @@ ikev2_ID_print(netdissect_options *ndo, u_char tpay,
                ND_TCHECK2(*typedata, idtype_len);
                for(i=0; i<idtype_len; i++) {
                        if(ND_ISPRINT(EXTRACT_U_1(typedata + i))) {
-                               ND_PRINT((ndo, "%c", typedata[i]));
+                               ND_PRINT((ndo, "%c", EXTRACT_U_1(typedata + i)));
                        } else {
                                ND_PRINT((ndo, "."));
                        }
index d7c70eeb54dad7d6704b4e000691147b007d6bc2..3493265fd2ff61f28b5008904c28adfec8b44b74 100644 (file)
--- a/smbutil.c
+++ b/smbutil.c
@@ -282,7 +282,7 @@ smb_print_data(netdissect_options *ndo, const unsigned char *buf, int len)
     ND_PRINT((ndo, "[%03X] ", i));
     for (i = 0; i < len; /*nothing*/) {
         ND_TCHECK(buf[i]);
-       ND_PRINT((ndo, "%02X ", buf[i] & 0xff));
+       ND_PRINT((ndo, "%02X ", EXTRACT_U_1(buf + i) & 0xff));
        i++;
        if (i%8 == 0)
            ND_PRINT((ndo, " "));