strrchr.c 154 B

1234567891011121314
  1. #include <lib9.h>
  2. char*
  3. strrchr(char *s, int c)
  4. {
  5. char *r;
  6. if(c == 0)
  7. return strchr(s, 0);
  8. r = 0;
  9. while(s = strchr(s, c))
  10. r = s++;
  11. return r;
  12. }