projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
only use memcpy realloc to shrink if an exact-sized free chunk exists
[oweals/musl.git]
/
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);