forked from KolibriOS/kolibrios
Add functions from <libgen.h>
Add memrchr.c git-svn-id: svn://kolibrios.org@7949 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
12
programs/develop/ktcc/trunk/libc/string/memrchr.c
Normal file
12
programs/develop/ktcc/trunk/libc/string/memrchr.c
Normal file
@@ -0,0 +1,12 @@
|
||||
/* memrchr.c from musl
|
||||
*/
|
||||
|
||||
#include <string.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;
|
||||
}
|
Reference in New Issue
Block a user