2 * Copyright (C) 2002 Manuel Novoa III
3 * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
12 /* Experimentally off - libc_hidden_proto(memrchr) */
14 void *memrchr(const void *s, int c, size_t n)
16 register const unsigned char *r;
18 /* bcc can optimize the counter if it thinks it is a pointer... */
19 register const char *np = (const char *) n;
24 r = ((unsigned char *)s) + ((size_t) np);
27 if (*--r == ((unsigned char)c)) {
28 return (void *) r; /* silence the warning */
37 libc_hidden_def(memrchr)