]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use more the ND_ISPRINT() macro
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 1 Dec 2017 09:17:11 +0000 (10:17 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 1 Dec 2017 09:17:11 +0000 (10:17 +0100)
print-radius.c

index 63d66242b9863dcec76835dedeb4fee9335a5aa9..fe7bde9228439e57d549cb55b02d6633875e422c 100644 (file)
@@ -633,7 +633,7 @@ print_attr_string(netdissect_options *ndo,
    }
 
    for (i=0; i < length && EXTRACT_U_1(data); i++, data++)
-       ND_PRINT((ndo, "%c", (EXTRACT_U_1(data) < 32 || EXTRACT_U_1(data) > 126) ? '.' : EXTRACT_U_1(data)));
+       ND_PRINT((ndo, "%c", ND_ISPRINT(EXTRACT_U_1(data)) ? EXTRACT_U_1(data) : '.'));
 
    return;
 
@@ -693,7 +693,7 @@ print_vendor_attr(netdissect_options *ndo,
                vendor_type,
                vendor_length));
         for (idx = 0; idx < vendor_length ; idx++, data++)
-            ND_PRINT((ndo, "%c", (EXTRACT_U_1(data) < 32 || EXTRACT_U_1(data) > 126) ? '.' : EXTRACT_U_1(data)));
+            ND_PRINT((ndo, "%c", ND_ISPRINT(EXTRACT_U_1(data)) ? EXTRACT_U_1(data) : '.'));
         length-=vendor_length;
     }
     return;