From 911a3ff97bc89d2f4e2103d2e5296cf1efab29cb Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Fri, 16 Jul 2004 05:10:46 +0000 Subject: [PATCH] Avoid passing negative values to functions on machines with signed chars. --- usr.bin/jot/jot.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c index 9314a7e31fe..f3f74235a96 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|