From: David Lamparter Date: Fri, 10 Apr 2015 07:14:30 +0000 (+0200) Subject: zebra, isisd: cast to unsigned char for ctypes X-Git-Tag: frr-2.0-rc1~750 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=27b87393125262780206642971f9576ed7931338;p=mirror%2Ffrr.git zebra, isisd: cast to unsigned char for ctypes ctype.h macros take int as arguments, but expect arguments to be in unsigned char's range. Even though it probably works, this isn't correct on systems that have a signed char type. Cast explicitly. Signed-off-by: David Lamparter (cherry picked from commit 52f02b47685bc823c4c75560175a27aab0bd6709) --- diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index 16ec409d4c..17ba40aa59 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -414,7 +414,7 @@ isis_circuit_id_gen (struct interface *ifp) */ for (i = 0; i < strlen (ifp->name); i++) { - if (isdigit(ifp->name[i])) + if (isdigit((unsigned char)ifp->name[i])) { if (start < 0) { diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 72ae21657f..f9caa85b19 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -1387,7 +1387,8 @@ DEFUN (ipv6_nd_prefix, if (argc > 1) { - if ((isdigit(argv[1][0])) || strncmp (argv[1], "i", 1) == 0) + if ((isdigit((unsigned char)argv[1][0])) + || strncmp (argv[1], "i", 1) == 0) { if ( strncmp (argv[1], "i", 1) == 0) rp.AdvValidLifetime = UINT32_MAX;