source:
trunk/sys/dietlibc/memrchr.c
@
131
Last change on this file since 131 was 1, checked in by , 8 years ago | |
---|---|
File size: 289 bytes |
Rev | Line | |
---|---|---|
[1] | 1 | #define _GNU_SOURCE |
2 | #include <string.h> | |
3 | ||
4 | void* memrchr(const void *s, int c, size_t n) { | |
5 | register const char* t=s; | |
6 | register const char* last=0; | |
7 | int i; | |
8 | for (i=n; i; --i) { | |
9 | if (*t==c) | |
10 | last=t; | |
11 | ++t; | |
12 | } | |
13 | return (void*)last; /* man, what an utterly b0rken prototype */ | |
14 | } |
Note: See TracBrowser
for help on using the repository browser.