1234567891011121314151617181920212223242526272829303132333435363738 |
- #include "_string.h"
- #ifdef __USE_GNU
- void *memrchr(const void *s, int c, size_t n)
- {
- register const unsigned char *r;
- #ifdef __BCC__
-
- register const char *np = (const char *) n;
- #else
- #define np n
- #endif
- r = ((unsigned char *)s) + ((size_t) np);
- while (np) {
- if (*--r == ((unsigned char)c)) {
- return (void *) r;
- }
- --np;
- }
- return NULL;
- }
- #undef np
- libc_hidden_def(memrchr)
- #endif
|