aboutsummaryrefslogtreecommitdiff
path: root/string
diff options
context:
space:
mode:
Diffstat (limited to 'string')
-rw-r--r--string/strrchr.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/string/strrchr.c b/string/strrchr.c
index 3c6e715..7b76dea 100644
--- a/string/strrchr.c
+++ b/string/strrchr.c
@@ -27,23 +27,7 @@
char *
STRRCHR (const char *s, int c)
{
- const char *found, *p;
-
- c = (unsigned char) c;
-
- /* Since strchr is fast, we use it rather than the obvious loop. */
-
- if (c == '\0')
- return strchr (s, '\0');
-
- found = NULL;
- while ((p = strchr (s, c)) != NULL)
- {
- found = p;
- s = p + 1;
- }
-
- return (char *) found;
+ return __memrchr (s, c, strlen (s) + 1);
}
#ifdef weak_alias