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:
@@ -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
|
||||||
|
@@ -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
|
||||||
|
Reference in New Issue
Block a user