summaryrefslogtreecommitdiffstats
path: root/usr.bin/jot
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-07-16 05:10:46 +0000
committertjr <tjr@FreeBSD.org>2004-07-16 05:10:46 +0000
commit512d638b0144d892c6a381fc8b6688b30b4795ad (patch)
tree4f79ca781b0360df6a4a78409e474d23c0c5aa38 /usr.bin/jot
parentb14b0e3eb86b2af78bee713b3ec8742ad1226b92 (diff)
downloadFreeBSD-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.c6
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|
OpenPOWER on IntegriCloud