diff options
Diffstat (limited to 'crypto/heimdal/lib/roken/strncasecmp.c')
-rw-r--r-- | crypto/heimdal/lib/roken/strncasecmp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/heimdal/lib/roken/strncasecmp.c b/crypto/heimdal/lib/roken/strncasecmp.c index 7c6474f..a08d9e8 100644 --- a/crypto/heimdal/lib/roken/strncasecmp.c +++ b/crypto/heimdal/lib/roken/strncasecmp.c @@ -33,7 +33,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> -RCSID("$Id: strncasecmp.c,v 1.2 1999/12/02 16:58:53 joda Exp $"); +RCSID("$Id: strncasecmp.c,v 1.3 2003/04/14 11:46:04 lha Exp $"); #endif #include <string.h> @@ -45,7 +45,9 @@ RCSID("$Id: strncasecmp.c,v 1.2 1999/12/02 16:58:53 joda Exp $"); int strncasecmp(const char *s1, const char *s2, size_t n) { - while(n > 0 && toupper(*s1) == toupper(*s2)) { + while(n > 0 + && toupper((unsigned char)*s1) == toupper((unsigned char)*s2)) + { if(*s1 == '\0') return 0; s1++; @@ -54,7 +56,7 @@ strncasecmp(const char *s1, const char *s2, size_t n) } if(n == 0) return 0; - return toupper(*s1) - toupper(*s2); + return toupper((unsigned char)*s1) - toupper((unsigned char)*s2); } #endif |