if (cm[*us1] != cm[*us2++])
return (cm[*us1] - cm[*--us2]);
if (*us1++ == '\0')
- break;
+ break;
} while (--n != 0);
- }
+ }
return (0);
}
return((char *)p);
if (!*p)
return((char *)NULL);
- }
+ }
/* NOTREACHED */
}
int
strcoll(const char *s1, const char *s2)
{
- return strcmp (s1, s2);
+ return strcmp(s1, s2);
}
if (n != 1) {
*d++ = *s;
n--;
- }
+ }
s++;
- }
+ }
*d = '\0';
return(dlen + (s - src)); /* count does not include NUL */
if ((*d++ = *s++) == '\0')
break;
}
- }
+ }
/* Not enough room in dst, add NUL and traverse rest of src */
if (n == 0) {
d++;
} while (--n != 0);
*d = 0;
- }
+ }
return (dst);
}
int
strncmp(const char *s1, const char *s2, size_t n)
{
-
if (n == 0)
return (0);
do {
if (*s1 != *s2++)
return (*(unsigned char *)s1 - *(unsigned char *)--s2);
if (*s1++ == 0)
- break;
+ break;
} while (--n != 0);
return (0);
}
/* NUL pad the remaining n-1 bytes */
while (--n != 0)
*d++ = 0;
- break;
- }
+ break;
+ }
} while (--n != 0);
}
return (dst);
{
const char *scanp;
int c, sc;
-
+
while ((c = *s1++) != 0) {
for (scanp = s2; (sc = *scanp++) != 0;)
if (sc == c)
strrchr(const char *p, int ch)
{
char *save;
-
+
for (save = NULL;; ++p) {
if (*p == ch)
save = (char *)p;
if (!*p)
return(save);
- }
+ }
/* NOTREACHED */
}
/*
* Get next token from string *stringp, where tokens are possibly-empty
- * strings separated by characters from delim.
+ * strings separated by characters from delim.
*
* Writes NULs into the string at *stringp to end tokens.
* delim need not remain constant from call to call.
} while (sc != c);
} while (strncmp(s, find, len) != 0);
s--;
- }
+ }
return ((char *)s);
}
/*
* Transform string s2 to string s1 using the current locale so that
- * strcmp of transformed strings yields the same result as strcoll.
+ * strcmp of transformed strings yields the same result as strcoll.
* Since Bionic really does not support locales, we assume we always use
* the C locale.
*