source: trunk/sys/dietlibc/memrchr.c @ 268

Last change on this file since 268 was 1, checked in by alain, 8 years ago

First import

File size: 289 bytes
RevLine 
[1]1#define _GNU_SOURCE
2#include <string.h>
3
4void* 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.