summaryrefslogtreecommitdiffstats
path: root/isisd/isis_misc.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-08-06 16:54:52 +0200
committerDavid Lamparter <equinox@diac24.net>2019-08-06 16:54:52 +0200
commitfefa5e0ff5af98d8258987e21422243926ee2b3c (patch)
tree05ad830d4a48048156689b15a5c84df124964cb6 /isisd/isis_misc.c
parentMerge pull request #4776 from pogojotz/write-config-fix (diff)
downloadfrr-fefa5e0ff5af98d8258987e21422243926ee2b3c.tar.xz
frr-fefa5e0ff5af98d8258987e21422243926ee2b3c.zip
*: fix ctype (isalpha & co.) casts
The correct cast for these is (unsigned char), because "char" could be signed and thus have some negative value. isalpha & co. expect an int arg that is positive, i.e. 0-255. So we need to cast to (unsigned char) when calling any of these. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'isisd/isis_misc.c')
-rw-r--r--isisd/isis_misc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/isisd/isis_misc.c b/isisd/isis_misc.c
index 3ad8278e1..a7f491e87 100644
--- a/isisd/isis_misc.c
+++ b/isisd/isis_misc.c
@@ -117,7 +117,8 @@ int dotformat2buff(uint8_t *buff, const char *dotted)
break;
}
- if ((isxdigit((int)*pos)) && (isxdigit((int)*(pos + 1)))) {
+ if ((isxdigit((unsigned char)*pos)) &&
+ (isxdigit((unsigned char)*(pos + 1)))) {
memcpy(number, pos, 2);
pos += 2;
} else {
@@ -157,7 +158,8 @@ int sysid2buff(uint8_t *buff, const char *dotted)
pos++;
continue;
}
- if ((isxdigit((int)*pos)) && (isxdigit((int)*(pos + 1)))) {
+ if ((isxdigit((unsigned char)*pos)) &&
+ (isxdigit((unsigned char)*(pos + 1)))) {
memcpy(number, pos, 2);
pos += 2;
} else {