]> git.proxmox.com Git - mirror_frr.git/commit - lib/command.c
*: fix ctype (isalpha & co.) casts
authorDavid Lamparter <equinox@diac24.net>
Tue, 6 Aug 2019 14:54:52 +0000 (16:54 +0200)
committerDavid Lamparter <equinox@diac24.net>
Tue, 6 Aug 2019 14:54:52 +0000 (16:54 +0200)
commitfefa5e0ff5af98d8258987e21422243926ee2b3c
tree05ad830d4a48048156689b15a5c84df124964cb6
parent7040d52aafca16fb0048c1712a919d8209c54dc9
*: 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>
22 files changed:
bgpd/bgp_aspath.c
bgpd/bgp_clist.c
bgpd/bgp_community.c
bgpd/bgp_dump.c
bgpd/bgp_ecommunity.c
bgpd/bgp_filter.c
bgpd/bgp_lcommunity.c
isisd/isis_misc.c
isisd/isis_tlvs.c
lib/command.c
lib/command_graph.c
lib/command_match.c
lib/filter.c
lib/frrstr.c
lib/log.c
lib/plist.c
lib/ptm_lib.c
lib/vty.c
tests/lib/cli/test_commands.c
tools/coccinelle/ctype_cast.cocci [new file with mode: 0644]
tools/start-stop-daemon.c
vtysh/vtysh.c