home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 316 / libsrc / strrchr.c < prev    next >
Encoding:
Text File  |  1988-10-20  |  436 b   |  26 lines

  1. /*
  2.  *        Cross Development System for Atari ST 
  3.  *     Copyright (c) 1988, Memorial University of Newfoundland
  4.  *
  5.  * $Header: strrchr.c,v 1.1 88/01/29 17:34:17 m68k Exp $
  6.  *
  7.  * $Log:    strrchr.c,v $
  8.  * Revision 1.1  88/01/29  17:34:17  m68k
  9.  * Initial revision
  10.  * 
  11.  */
  12. char    *
  13. strrchr(s, c)
  14.     char    *s;
  15.     char    c;
  16. {
  17.     int    n = 0;
  18.  
  19.     while (*s++)
  20.         n++;
  21.     while (--n >= 0)
  22.         if (*--s == c)
  23.             return s;
  24.     return (char *) 0;
  25. }
  26.