From f0aacec02eb04f1843cc5c729fd5510c2342660c Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 17 Apr 2008 10:19:58 +0000 Subject: Cast to unsigned char for ctype calls. --- src/rc/rc-applets.c | 4 ++-- src/rc/rc-logger.c | 2 +- src/rc/rc-misc.c | 4 ++-- src/rc/rc.c | 2 +- src/rc/start-stop-daemon.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/rc') diff --git a/src/rc/rc-applets.c b/src/rc/rc-applets.c index d434be44..60c0c272 100644 --- a/src/rc/rc-applets.c +++ b/src/rc/rc-applets.c @@ -58,7 +58,7 @@ static int syslog_decode(char *name, CODE *codetab) { CODE *c; - if (isdigit((int) *name)) + if (isdigit((unsigned char)*name)) return atoi(name); for (c = codetab; c->c_name; c++) @@ -351,7 +351,7 @@ static int do_shell_var(int argc, char **argv) putchar(' '); while (*p) { - c = *p++; + c = (unsigned char)*p++; if (! isalnum(c)) c = '_'; putchar(c); diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c index 96b7bb73..8f62ebae 100644 --- a/src/rc/rc-logger.c +++ b/src/rc/rc-logger.c @@ -103,7 +103,7 @@ static void write_log(int logfd, const char *buffer, size_t bytes) continue; } - if (! in_term || isalpha((int) *p)) + if (! in_term || isalpha((unsigned char)*p)) in_escape = in_term = false; cont: p++; diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c index 6e94ad69..85140aac 100644 --- a/src/rc/rc-misc.c +++ b/src/rc/rc-misc.c @@ -93,8 +93,8 @@ char *rc_conf_value(const char *setting) TAILQ_FOREACH(s, rc_conf, entries) { p = s->value; while (p && *p && *p != '=') { - if (isupper((int) *p)) - *p = tolower((int) *p); + if (isupper((unsigned char)*p)) + *p = tolower((unsigned char)*p); p++; } } diff --git a/src/rc/rc.c b/src/rc/rc.c index dee07324..b8149239 100644 --- a/src/rc/rc.c +++ b/src/rc/rc.c @@ -582,7 +582,7 @@ static void do_coldplug(void) strncmp(d->d_name, "ums", 3) == 0) { p = d->d_name + 3; - if (p && isdigit((int) *p)) { + if (p && isdigit((unsigned char)*p)) { l = strlen("moused.") + strlen(d->d_name) + 1; service = xmalloc(sizeof(char) * l); snprintf (service, l, "moused.%s", d->d_name); diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c index d96e5f61..24505da0 100644 --- a/src/rc/start-stop-daemon.c +++ b/src/rc/start-stop-daemon.c @@ -190,7 +190,7 @@ static SCHEDULEITEM *parse_schedule_item(const char *string) item->gotoitem = NULL; if (strcmp(string,"forever") == 0) item->type = SC_FOREVER; - else if (isdigit((int) string[0])) { + else if (isdigit((unsigned char)string[0])) { item->type = SC_TIMEOUT; errno = 0; if (sscanf(string, "%d", &item->value) != 1) -- cgit v1.2.3