#if !defined (HAVE_STRCASECMP)
#if !defined (to_lower)
-# define to_lower(c) (islower(c) ? (c) : toupper(c))
+# define to_lower(c) (islower(c) ? (c) : tolower(c))
#endif /* to_lower */
/* Compare at most COUNT characters from string1 to string2. Case
doesn't matter. */
int
strncasecmp (string1, string2, count)
- char *string1, *string2;
+ const char *string1, *string2;
int count;
{
register char *s1, *s2;
if (count > 0)
{
- s1 = string1;
- s2 = string2;
+ s1 = (char *)string1;
+ s2 = (char *)string2;
do
{
if ((r = to_lower (*s1) - to_lower (*s2)) != 0)
/* strcmp (), but caseless. */
int
strcasecmp (string1, string2)
- char *string1, *string2;
+ const char *string1, *string2;
{
register char *s1, *s2;
register int r;
- s1 = string1;
- s2 = string2;
+ s1 = (char *)string1;
+ s2 = (char *)string2;
while ((r = to_lower (*s1) - to_lower (*s2)) == 0)
{
int n;
{
register int i;
+ register char *r;
- for (i = 0; i < n; i++)
- s[i] = '\0';
+ for (i = 0, r = s; i < n; i++)
+ *r++ = '\0';
}
#endif