scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

strrchr.c (182B)


      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) ? t : NULL;
     16 }