Cast to unsigned char for ctype calls.

This commit is contained in:
Roy Marples 2008-04-17 10:19:58 +00:00
parent 57e1dd7389
commit f0aacec02e
6 changed files with 8 additions and 8 deletions

View File

@ -847,7 +847,7 @@ bool rc_deptree_update(void)
nosys[0] = 'n';
nosys[1] = 'o';
for (i = 0; i < len; i++)
nosys[i + 2] = (char) tolower((int) sys[i]);
nosys[i + 2] = (char)tolower((unsigned char)sys[i]);
nosys[i + 2] = '\0';
STAILQ_FOREACH_SAFE(depinfo, deptree, entries, depinfo_np)

View File

@ -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);

View File

@ -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++;

View File

@ -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++;
}
}

View File

@ -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);

View File

@ -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)