]> git.proxmox.com Git - wasi-libc.git/blob - libc-top-half/musl/src/string/memrchr.c
WASI libc prototype implementation.
[wasi-libc.git] / libc-top-half / musl / src / string / memrchr.c
1 #include <string.h>
2
3 void *__memrchr(const void *m, int c, size_t n)
4 {
5 const unsigned char *s = m;
6 c = (unsigned char)c;
7 while (n--) if (s[n]==c) return (void *)(s+n);
8 return 0;
9 }
10
11 weak_alias(__memrchr, memrchr);