summaryrefslogtreecommitdiffstats
path: root/tools/start-stop-daemon.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 /tools/start-stop-daemon.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 'tools/start-stop-daemon.c')
-rw-r--r--tools/start-stop-daemon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/start-stop-daemon.c b/tools/start-stop-daemon.c
index 5903f8732..c75306a95 100644
--- a/tools/start-stop-daemon.c
+++ b/tools/start-stop-daemon.c
@@ -401,7 +401,7 @@ static void parse_schedule_item(const char *string, struct schedule_item *item)
if (!strcmp(string, "forever")) {
item->type = sched_forever;
- } else if (isdigit((int)string[0])) {
+ } else if (isdigit((unsigned char)string[0])) {
item->type = sched_timeout;
if (parse_integer(string, &item->value) != 0)
badusage("invalid timeout value in schedule");