mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-16 01:36:41 +08:00
IFCONFIG(8): Fix isdigit() and isprint() usage
This commit is contained in:
parent
13b50b37cc
commit
8ff186f81f
@ -116,7 +116,7 @@ in_getaddr(const char *s, int which)
|
|||||||
int masklen;
|
int masklen;
|
||||||
struct sockaddr_in *min = sintab[MASK];
|
struct sockaddr_in *min = sintab[MASK];
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
if (!isdigit(*(p + 1)))
|
if (!isdigit((unsigned char)*(p + 1)))
|
||||||
errstr = "invalid";
|
errstr = "invalid";
|
||||||
else
|
else
|
||||||
masklen = (int)strtonum(p + 1, 0, 32, &errstr);
|
masklen = (int)strtonum(p + 1, 0, 32, &errstr);
|
||||||
|
@ -155,7 +155,7 @@ bridge_interfaces(int s, const char *prefix)
|
|||||||
err(1, "strdup");
|
err(1, "strdup");
|
||||||
/* replace the prefix with whitespace */
|
/* replace the prefix with whitespace */
|
||||||
for (p = pad; *p != '\0'; p++) {
|
for (p = pad; *p != '\0'; p++) {
|
||||||
if(isprint(*p))
|
if(isprint((unsigned char)*p))
|
||||||
*p = ' ';
|
*p = ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ setifgroup(const char *group_name, int d, int s, const struct afswtch *rafp)
|
|||||||
memset(&ifgr, 0, sizeof(ifgr));
|
memset(&ifgr, 0, sizeof(ifgr));
|
||||||
strlcpy(ifgr.ifgr_name, name, IFNAMSIZ);
|
strlcpy(ifgr.ifgr_name, name, IFNAMSIZ);
|
||||||
|
|
||||||
if (group_name[0] && isdigit(group_name[strlen(group_name) - 1]))
|
if (group_name[0] && isdigit((unsigned char)group_name[strlen(group_name) - 1]))
|
||||||
errx(1, "setifgroup: group names may not end in a digit");
|
errx(1, "setifgroup: group names may not end in a digit");
|
||||||
|
|
||||||
if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ)
|
if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ)
|
||||||
@ -70,7 +70,7 @@ unsetifgroup(const char *group_name, int d, int s, const struct afswtch *rafp)
|
|||||||
memset(&ifgr, 0, sizeof(ifgr));
|
memset(&ifgr, 0, sizeof(ifgr));
|
||||||
strlcpy(ifgr.ifgr_name, name, IFNAMSIZ);
|
strlcpy(ifgr.ifgr_name, name, IFNAMSIZ);
|
||||||
|
|
||||||
if (group_name[0] && isdigit(group_name[strlen(group_name) - 1]))
|
if (group_name[0] && isdigit((unsigned char)group_name[strlen(group_name) - 1]))
|
||||||
errx(1, "unsetifgroup: group names may not end in a digit");
|
errx(1, "unsetifgroup: group names may not end in a digit");
|
||||||
|
|
||||||
if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ)
|
if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user