From c12532d6856270abf1496339e777fd7994fbc9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 14 Apr 2003 11:46:41 +0000 Subject: [PATCH] cast argument to toupper to unsigned char, from Christian Biere via NetBSD git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12009 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/strncasecmp.c | 6 ++++-- lib/roken/strupr.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/roken/strncasecmp.c b/lib/roken/strncasecmp.c index 943f44464..ed2f475c2 100644 --- a/lib/roken/strncasecmp.c +++ b/lib/roken/strncasecmp.c @@ -45,7 +45,9 @@ RCSID("$Id$"); 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 diff --git a/lib/roken/strupr.c b/lib/roken/strupr.c index 26e9dcedf..1f617e306 100644 --- a/lib/roken/strupr.c +++ b/lib/roken/strupr.c @@ -47,7 +47,7 @@ strupr(char *str) char *s; for(s = str; *s; s++) - *s = toupper(*s); + *s = toupper((unsigned char)*s); return str; } #endif