]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Squelch a signed array subscript warning.
authorGuy Harris <[email protected]>
Sun, 7 Aug 2016 22:35:54 +0000 (15:35 -0700)
committerGuy Harris <[email protected]>
Sun, 7 Aug 2016 22:35:54 +0000 (15:35 -0700)
As the string in question is passed as a constant from a printer, it
*shouldn't* contain any non-ASCII characters, but squelching the warning
is harmless and, on modern processors, a non-sign-extending byte load
shouldn't be any worse than a sign-extending byte load.

util-print.c

index 6858ce3672012a6b5b4718f684aa4606dc6e6359..113f784660c8652d8da5bcddc8a347d617904a8a 100644 (file)
@@ -783,7 +783,7 @@ txtproto_print(netdissect_options *ndo, const u_char *pptr, u_int len,
 
        /* Capitalize the protocol name */
        for (pnp = protoname; *pnp != '\0'; pnp++)
-               ND_PRINT((ndo, "%c", toupper(*pnp)));
+               ND_PRINT((ndo, "%c", toupper((u_char)*pnp)));
 
        if (is_reqresp) {
                /*