From 27b87393125262780206642971f9576ed7931338 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 10 Apr 2015 09:14:30 +0200 Subject: [PATCH] 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) --- isisd/isis_circuit.c | 2 +- zebra/rtadv.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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; -- 2.39.5