strrchr.c 387 B

12345678910111213141516171819202122
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Id$ */
  6. #include <string.h>
  7. char *
  8. strrchr(register const char *s, int c)
  9. {
  10. register const char *result = NULL;
  11. c = (char) c;
  12. do {
  13. if (c == *s)
  14. result = s;
  15. } while (*s++ != '\0');
  16. return (char *)result;
  17. }