From 1e83468c0337ff11854997e2c1e105c012ad5cc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Fri, 6 Oct 2006 07:30:54 +0000 Subject: [PATCH] Cast argument to ctype(3) functions to (unsigned char). git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18253 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/des/imath/imath.c | 8 ++++---- lib/des/imath/imrat.c | 6 +++--- lib/gssapi/mech/gss_mech_switch.c | 6 +++--- lib/gssapi/spnego/accept_sec_context.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/des/imath/imath.c b/lib/des/imath/imath.c index deeec54f3..56bd65668 100755 --- a/lib/des/imath/imath.c +++ b/lib/des/imath/imath.c @@ -1798,7 +1798,7 @@ mp_result mp_int_read_cstring(mp_int z, mp_size radix, const char *str, char **e return MP_RANGE; /* Skip leading whitespace */ - while(isspace((int)*str)) + while(isspace((unsigned char)*str)) ++str; /* Handle leading sign tag (+/-, positive default) */ @@ -3126,10 +3126,10 @@ static int s_ch2val(char c, int r) { int out; - if(isdigit((int)c)) + if(isdigit((unsigned char)c)) out = c - '0'; - else if(r > 10 && isalpha((int)c)) - out = toupper(c) - 'A' + 10; + else if(r > 10 && isalpha((unsigned char)c)) + out = toupper((unsigned char)c) - 'A' + 10; else return -1; diff --git a/lib/des/imath/imrat.c b/lib/des/imath/imrat.c index 0e275a46e..768b31a5a 100755 --- a/lib/des/imath/imrat.c +++ b/lib/des/imath/imrat.c @@ -829,7 +829,7 @@ mp_result mp_rat_read_cstring(mp_rat r, mp_size radix, const char *str, return res; /* Skip whitespace between numerator and (possible) separator */ - while(isspace(*endp)) + while(isspace((unsigned char)*endp)) ++endp; /* If there is no separator, we will stop reading at this point. */ @@ -905,7 +905,7 @@ mp_result mp_rat_read_cdecimal(mp_rat r, mp_size radix, const char *str, mp_sign osign; char *endp; - while(isspace((int) *str)) + while(isspace((unsigned char) *str)) ++str; switch(*str) { @@ -944,7 +944,7 @@ mp_result mp_rat_read_cdecimal(mp_rat r, mp_size radix, const char *str, *end = endp; return MP_OK; } - else if(isspace(*endp) || *endp == '-' || *endp == '+') { + else if(isspace((unsigned char)*endp) || *endp == '-' || *endp == '+') { return MP_TRUNC; } else { diff --git a/lib/gssapi/mech/gss_mech_switch.c b/lib/gssapi/mech/gss_mech_switch.c index c7cbbe0d3..9cf96f6b7 100644 --- a/lib/gssapi/mech/gss_mech_switch.c +++ b/lib/gssapi/mech/gss_mech_switch.c @@ -227,11 +227,11 @@ _gss_load_mech(void) continue; p = buf; name = strsep(&p, "\t\n "); - if (p) while (isspace(*p)) p++; + if (p) while (isspace((unsigned char)*p)) p++; oid = strsep(&p, "\t\n "); - if (p) while (isspace(*p)) p++; + if (p) while (isspace((unsigned char)*p)) p++; lib = strsep(&p, "\t\n "); - if (p) while (isspace(*p)) p++; + if (p) while (isspace((unsigned char)*p)) p++; kobj = strsep(&p, "\t\n "); if (!name || !oid || !lib || !kobj) continue; diff --git a/lib/gssapi/spnego/accept_sec_context.c b/lib/gssapi/spnego/accept_sec_context.c index 8705ab99c..7fd36dfde 100644 --- a/lib/gssapi/spnego/accept_sec_context.c +++ b/lib/gssapi/spnego/accept_sec_context.c @@ -243,7 +243,7 @@ send_supported_mechs (OM_uint32 *minor_status, /* Send the constructed SAM name for this host */ for (p = hostname; *p != '\0' && *p != '.'; p++) { - *p = toupper(*p); + *p = toupper((unsigned char)*p); } *p++ = '$'; *p = '\0';