home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / file39a.zip / src / localsrc / strchr.c < prev    next >
C/C++ Source or Header  |  1993-04-05  |  262b  |  22 lines

  1. /*
  2.  * Local copy of strchr (a.k.a. index) for portability.
  3.  * Totally public domain.
  4.  */
  5.  
  6. #include <stdio.h>
  7.  
  8. char *
  9. strchr(s, c)
  10. char *s, c;
  11. {
  12.     char *x = s;
  13.  
  14.     while (*x != c)
  15.         if (*x == '\0')
  16.             return(NULL);
  17.         else
  18.             ++x;
  19.     return(x);
  20. }
  21.  
  22.