summaryrefslogtreecommitdiff
path: root/usr.bin/cdio
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-20 20:54:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-20 20:54:35 +0000
commitc507b95ebf77817b439f55542b0932c60c420a4c (patch)
treebe79facfddd1a98621be9764ac54bb004ffa762f /usr.bin/cdio
parent8927102be4f9fac5a25493cde928757927c4438e (diff)
unsigned char casts where neccessary
ok ratchov
Diffstat (limited to 'usr.bin/cdio')
-rw-r--r--usr.bin/cdio/cdio.c21
-rw-r--r--usr.bin/cdio/rip.c8
2 files changed, 15 insertions, 14 deletions
diff --git a/usr.bin/cdio/cdio.c b/usr.bin/cdio/cdio.c
index a792073e97c..4be37621b16 100644
--- a/usr.bin/cdio/cdio.c
+++ b/usr.bin/cdio/cdio.c
@@ -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;
}
diff --git a/usr.bin/cdio/rip.c b/usr.bin/cdio/rip.c
index b28a1c2b01d..0fe0d8e88d1 100644
--- a/usr.bin/cdio/rip.c
+++ b/usr.bin/cdio/rip.c
@@ -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);