10 lines
182 B
C
10 lines
182 B
C
|
#include <stddef.h>
|
||
|
|
||
|
void *memrchr(const void *m, int c, size_t n)
|
||
|
{
|
||
|
const unsigned char *s = m;
|
||
|
c = (unsigned char)c;
|
||
|
while (n--) if (s[n]==c) return (void *)(s+n);
|
||
|
return 0;
|
||
|
}
|