]> The Tcpdump Group git mirrors - tcpdump/commitdiff
This is an array of 16 character values, not a C character string.
authorGuy Harris <[email protected]>
Thu, 14 Sep 2017 18:59:38 +0000 (11:59 -0700)
committerGuy Harris <[email protected]>
Thu, 14 Sep 2017 18:59:38 +0000 (11:59 -0700)
Don't initialize it with a string, so no compiler whinges about there
being no room for a null terminator.

addrtoname.c

index 88af3c82b69486235be0f4d83ac9f493c01e9232..fe6338d5a45602b700f94087dba1689eea06b808 100644 (file)
@@ -352,8 +352,10 @@ getname6(netdissect_options *ndo, const u_char *ap)
        return (p->name);
 }
 
-static const char hex[16] = "0123456789abcdef";
-
+static const char hex[16] = {
+       '0', '1', '2', '3', '4', '5', '6', '7',
+       '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
+};
 
 /* Find the hash node that corresponds the ether address 'ep' */