From 88ba491496daf4463a2c898be8a6c47775a6d048 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 25 Oct 1999 16:58:21 +0000 Subject: [PATCH] char is signed on some platforms. ensure that isupper() & isdigit() are called with positive ints. --- lib/dns/rdata.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index a11286879f..c2364b6ba8 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -15,7 +15,7 @@ * SOFTWARE. */ - /* $Id: rdata.c,v 1.63 1999/10/17 22:34:16 tale Exp $ */ + /* $Id: rdata.c,v 1.64 1999/10/25 16:58:21 marka Exp $ */ #include @@ -648,7 +648,8 @@ dns_mnemonic_fromtext(unsigned int *valuep, isc_textregion_t *source, { int i; - if (isdigit(source->base[0]) && source->length <= NUMBERSIZE - 1) { + if (isdigit(source->base[0] & 0xff) && + source->length <= NUMBERSIZE - 1) { unsigned int n; char *e; char buffer[NUMBERSIZE]; @@ -821,7 +822,8 @@ dns_keyflags_fromtext(dns_keyflags_t *flagsp, isc_textregion_t *source) char *text, *end; unsigned int value, mask; - if (isdigit(source->base[0]) && source->length <= NUMBERSIZE - 1) { + if (isdigit(source->base[0] & 0xff) && + source->length <= NUMBERSIZE - 1) { unsigned int n; char *e; char buffer[NUMBERSIZE]; @@ -1209,9 +1211,9 @@ compare_region(isc_region_t *r1, isc_region_t *r2) { static int hexvalue(char value) { char *s; - if (!isascii(value&0xff)) + if (!isascii(value & 0xff)) return (-1); - if (isupper(value)) + if (isupper(value & 0xff)) value = tolower(value); if ((s = strchr(hexdigits, value)) == NULL) return (-1);