]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
interfaces: fix use of isdigit()
authorVincent Bernat <vincent@bernat.ch>
Sat, 11 Feb 2023 09:59:53 +0000 (10:59 +0100)
committerVincent Bernat <vincent@bernat.ch>
Sat, 11 Feb 2023 10:04:19 +0000 (11:04 +0100)
It is expecting an unsigned char. Make a cast.

src/daemon/interfaces-bsd.c

index 35e6f4042952d6417f5a3c0c6c691487d1120ba3..a8248fe96003ced1ca9c04c8458116adabceecea 100644 (file)
@@ -310,7 +310,9 @@ ifbsd_denylist(struct lldpd *cfg, struct interfaces_device_list *interfaces)
                int i;
                if (strncmp(iface->name, "p2p", 3)) continue;
                if (strlen(iface->name) < 4) continue;
-               for (i = 3; iface->name[i] != '\0' && isdigit(iface->name[i]); i++)
+               for (i = 3;
+                    iface->name[i] != '\0' && isdigit((unsigned char)(iface->name[i]));
+                    i++)
                        ;
                if (iface->name[i] == '\0') {
                        log_debug("interfaces", "skip %s: AirDrop interface",