home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Resources / System / BoingBag1 / Contributions / Workbench / RexxArpLib3p6 / src / strchr.c < prev    next >
C/C++ Source or Header  |  1998-06-20  |  461b  |  28 lines

  1. /* At least one version of SC (6.57) has these two functions broken!!!!
  2.    Alas, we use them!
  3.     extern char *strchr(const char *, int);
  4.     extern char *strrchr(const char *, int);
  5. char *strchr(const char *s, int c)
  6. {
  7.     if (c == 0)
  8.         return(NULL);
  9.     while( *s )
  10.         if (*s++ == c)
  11.             return(s--);
  12.     return( NULL );
  13. }
  14.  
  15. char *strrchr(const char *s, int c)
  16. {
  17.     char *p = NULL;
  18.  
  19.     if (c == 0)
  20.         return(NULL);
  21.     while ( *s )
  22.         if (*s++ == c)
  23.             p = s - 1;
  24.     return ( s );
  25. }
  26.  */
  27.  
  28.