aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/rs
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2004-07-15 10:26:38 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2004-07-15 10:26:38 +0000
commita2b28f9d9a168182a6630b06ff46845155472eeb (patch)
tree8079609b283e75ecf52fc51b5ee58125ec20df64 /usr.bin/rs
parent6489fd21484b952e78c27a94d785eef5f3bc9382 (diff)
downloadsrc-a2b28f9d9a168182a6630b06ff46845155472eeb.tar.gz
src-a2b28f9d9a168182a6630b06ff46845155472eeb.zip
Avoid passing negative values to isdigit() on machines with signed chars.
Notes
Notes: svn path=/head/; revision=132205
Diffstat (limited to 'usr.bin/rs')
-rw-r--r--usr.bin/rs/rs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/rs/rs.c b/usr.bin/rs/rs.c
index 36d7c312c5be..98cc3d4d16c2 100644
--- a/usr.bin/rs/rs.c
+++ b/usr.bin/rs/rs.c
@@ -499,11 +499,11 @@ getlist(short **list, char *p)
char *t;
for (t = p + 1; *t; t++) {
- if (!isdigit(*t))
+ if (!isdigit((unsigned char)*t))
errx(1,
"option %.1s requires a list of unsigned numbers separated by commas", t);
count++;
- while (*t && isdigit(*t))
+ while (*t && isdigit((unsigned char)*t))
t++;
if (*t != ',')
break;
@@ -515,7 +515,7 @@ getlist(short **list, char *p)
(*list)[count++] = atoi(t);
printf("++ %d ", (*list)[count-1]);
fflush(stdout);
- while (*t && isdigit(*t))
+ while (*t && isdigit((unsigned char)*t))
t++;
if (*t != ',')
break;
@@ -533,7 +533,7 @@ getnum(int *num, char *p, int strict)
{
char *t = p;
- if (!isdigit(*++t)) {
+ if (!isdigit((unsigned char)*++t)) {
if (strict || *t == '-' || *t == '+')
errx(1, "option %.1s requires an unsigned integer", p);
*num = 0;
@@ -541,7 +541,7 @@ getnum(int *num, char *p, int strict)
}
*num = atoi(t);
while (*++t)
- if (!isdigit(*t))
+ if (!isdigit((unsigned char)*t))
break;
return(--t);
}