|
|
1.1 ! root 1: /* ! 2: * strrchr.c ! 3: * ANSI 4.11.5.5. ! 4: * Search string in reverse. ! 5: * Previously known as rindex(). ! 6: */ ! 7: ! 8: #include <string.h> ! 9: ! 10: char *strrchr(s, c) char *s; int c; ! 11: { ! 12: register char *cp; ! 13: char ch; ! 14: ! 15: ch = (char)c; ! 16: for (cp = s; *cp++; ) ! 17: ; ! 18: while (cp > s) ! 19: if (*--cp == ch) ! 20: return (cp); ! 21: return (NULL); ! 22: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.