X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstring%2Fstrrchr.c;h=635fb3c1dcde17abaf662e8cb9952c00e45f5471;hp=31c8e0b8d2108e36cb391111346f6824511bccc9;hb=3f9ff1514e49b06c20a61af9ae9e52bd53b48d9a;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01 diff --git a/src/string/strrchr.c b/src/string/strrchr.c index 31c8e0b8..635fb3c1 100644 --- a/src/string/strrchr.c +++ b/src/string/strrchr.c @@ -1,9 +1,8 @@ #include +void *__memrchr(const void *, int, size_t); + char *strrchr(const char *s, int c) { - const char *p; - c = (char)c; - for (p=s+strlen(s); p>=s && *p!=c; p--); - return p>=s ? (char *)p : 0; + return __memrchr(s, c, strlen(s) + 1); }