diff options
author | David Lamparter <equinox@diac24.net> | 2019-08-06 16:54:52 +0200 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2019-08-06 16:54:52 +0200 |
commit | fefa5e0ff5af98d8258987e21422243926ee2b3c (patch) | |
tree | 05ad830d4a48048156689b15a5c84df124964cb6 /bgpd/bgp_clist.c | |
parent | Merge pull request #4776 from pogojotz/write-config-fix (diff) | |
download | frr-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 'bgpd/bgp_clist.c')
-rw-r--r-- | bgpd/bgp_clist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c index ad5553d9a..29e668d17 100644 --- a/bgpd/bgp_clist.c +++ b/bgpd/bgp_clist.c @@ -157,7 +157,7 @@ community_list_insert(struct community_list_handler *ch, const char *name, /* If name is made by all digit character. We treat it as number. */ for (number = 0, i = 0; i < strlen(name); i++) { - if (isdigit((int)name[i])) + if (isdigit((unsigned char)name[i])) number = (number * 10) + (name[i] - '0'); else break; |