strrchr.c - scc - simple c99 compiler
HTML git clone git://git.simple-cc.org/scc
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
strrchr.c (191B)
---
1 #include <string.h>
2
3 #undef strrchr
4
5 char *
6 strrchr(const char *s, int c)
7 {
8 const char *t = s;
9
10 while (*t)
11 ++t;
12 while (t > s && *t != c)
13 --t;
14
15 return (*t == c) ? (char *) t : NULL;
16 }