1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

unsigned char casts where neccessary

ok ratchov
This commit is contained in:
deraadt 2013-11-20 20:54:34 +00:00
parent 56c00d48cb
commit 20ae320826
2 changed files with 15 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: cdio.c,v 1.72 2010/03/01 02:09:44 krw Exp $ */
/* $OpenBSD: cdio.c,v 1.73 2013/11/20 20:54:34 deraadt Exp $ */
/* Copyright (c) 1995 Serge V. Vakulenko
* All rights reserved.
@ -205,7 +205,7 @@ help(void)
printf("\t");
for (i = c->min, s = c->name; *s; s++, i--) {
if (i > 0)
n = toupper(*s);
n = toupper((unsigned char)*s);
else
n = *s;
putchar(n);
@ -455,7 +455,7 @@ run(int cmd, char *arg)
if (!open_cd(cdname, 0))
return (0);
while (isspace(*arg))
while (isspace((unsigned char)*arg))
arg++;
return play(arg);
@ -531,7 +531,7 @@ run(int cmd, char *arg)
if (!open_cd(cdname, 0))
return (0);
while (isspace(*arg))
while (isspace((unsigned char)*arg))
arg++;
return cdrip(arg);
@ -539,7 +539,7 @@ run(int cmd, char *arg)
if (!open_cd(cdname, 0))
return (0);
while (isspace(*arg))
while (isspace((unsigned char)*arg))
arg++;
return cdplay(arg);
@ -712,7 +712,7 @@ play(char *arg)
* sscanf() formats we catch any errant trailing characters.
*/
rc = strlen(arg) - 1;
while (rc >= 0 && isspace(arg[rc])) {
while (rc >= 0 && isspace((unsigned char)arg[rc])) {
arg[rc] = '\0';
rc--;
}
@ -1524,15 +1524,16 @@ parse(char *buf, int *cmd)
char *p;
size_t len;
for (p=buf; isspace(*p); p++)
for (p=buf; isspace((unsigned char)*p); p++)
continue;
if (isdigit(*p) || (p[0] == '#' && isdigit(p[1]))) {
if (isdigit((unsigned char)*p) ||
(p[0] == '#' && isdigit((unsigned char)p[1]))) {
*cmd = CMD_PLAY;
return (p);
}
for (buf = p; *p && ! isspace(*p); p++)
for (buf = p; *p && ! isspace((unsigned char)*p); p++)
continue;
len = p - buf;
@ -1572,7 +1573,7 @@ parse(char *buf, int *cmd)
return (0);
}
while (isspace(*p))
while (isspace((unsigned char)*p))
p++;
return p;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: rip.c,v 1.13 2013/11/12 17:57:34 deraadt Exp $ */
/* $OpenBSD: rip.c,v 1.14 2013/11/20 20:54:34 deraadt Exp $ */
/*
* Copyright (c) 2007 Alexey Vatchenko <av@bsdua.org>
@ -124,7 +124,7 @@ _parse_val(char *start, char *nxt, int *val)
if (n > 3 || n < 1)
return (-1);
for (p = start; p < nxt; p++) {
if (!isdigit(*p))
if (!isdigit((unsigned char)*p))
return (-1);
}
@ -260,14 +260,14 @@ parse_tracks(struct track_pair_head *head, u_char first, u_char last,
p = (char *)arg;
for (;;) {
/* Skip trailing spaces */
while (*p != '\0' && isspace(*p))
while (*p != '\0' && isspace((unsigned char)*p))
++p;
if (*p == '\0')
break;
/* Search for the next space symbol */
nxt = p;
while (*nxt != '\0' && !isspace(*nxt))
while (*nxt != '\0' && !isspace((unsigned char)*nxt))
++nxt;
/* ``nxt'' can't be equal to ``p'' here */
error = _parse_pair(p, nxt, &val1, &val2);