diff options
author | tjr <tjr@FreeBSD.org> | 2004-07-16 05:10:46 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-07-16 05:10:46 +0000 |
commit | 512d638b0144d892c6a381fc8b6688b30b4795ad (patch) | |
tree | 4f79ca781b0360df6a4a78409e474d23c0c5aa38 /usr.bin/jot | |
parent | b14b0e3eb86b2af78bee713b3ec8742ad1226b92 (diff) | |
download | FreeBSD-src-512d638b0144d892c6a381fc8b6688b30b4795ad.zip FreeBSD-src-512d638b0144d892c6a381fc8b6688b30b4795ad.tar.gz |
Avoid passing negative values to <ctype.h> functions on machines with
signed chars.
Diffstat (limited to 'usr.bin/jot')
-rw-r--r-- | usr.bin/jot/jot.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c index 9314a7e..f3f7423 100644 --- a/usr.bin/jot/jot.c +++ b/usr.bin/jot/jot.c @@ -344,7 +344,7 @@ getprec(char *str) if (!*p) return (0); for (q = ++p; *p; p++) - if (!isdigit(*p)) + if (!isdigit((unsigned char)*p)) break; return (p - q); } @@ -381,8 +381,8 @@ getformat(void) */ p2 = p++; dot = hash = space = sign = numbers = 0; - while (!isalpha(*p)) { - if (isdigit(*p)) { + while (!isalpha((unsigned char)*p)) { + if (isdigit((unsigned char)*p)) { numbers++; p++; } else if ((*p == '#' && !(numbers|dot|sign|space| |