cast argument to toupper to unsigned char,

from Christian Biere <christianbiere@gmx.de> via NetBSD


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12009 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2003-04-14 11:46:41 +00:00
parent 42b442ed1c
commit c12532d685
2 changed files with 5 additions and 3 deletions

View File

@@ -45,7 +45,9 @@ RCSID("$Id$");
int int
strncasecmp(const char *s1, const char *s2, size_t n) 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') if(*s1 == '\0')
return 0; return 0;
s1++; s1++;
@@ -54,7 +56,7 @@ strncasecmp(const char *s1, const char *s2, size_t n)
} }
if(n == 0) if(n == 0)
return 0; return 0;
return toupper(*s1) - toupper(*s2); return toupper((unsigned char)*s1) - toupper((unsigned char)*s2);
} }
#endif #endif

View File

@@ -47,7 +47,7 @@ strupr(char *str)
char *s; char *s;
for(s = str; *s; s++) for(s = str; *s; s++)
*s = toupper(*s); *s = toupper((unsigned char)*s);
return str; return str;
} }
#endif #endif