]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra, isisd: cast to unsigned char for ctypes
authorDavid Lamparter <equinox@opensourcerouting.org>
Fri, 10 Apr 2015 07:14:30 +0000 (09:14 +0200)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 26 May 2016 15:33:29 +0000 (15:33 +0000)
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 <equinox@opensourcerouting.org>
(cherry picked from commit 52f02b47685bc823c4c75560175a27aab0bd6709)

isisd/isis_circuit.c
zebra/rtadv.c

index 16ec409d4cfd664e855c1a23d12a92177ccbde68..17ba40aa598698555835b1eb4a8ad2407868fa0a 100644 (file)
@@ -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)
             {
index 72ae21657ff5d2dd6ba31ad68126767d368da917..f9caa85b19791b5c20d720035743bc34a41d041e 100644 (file)
@@ -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;