home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 109.lha / PD_C / lib / strpbrk.c < prev    next >
Text File  |  1986-11-20  |  576b  |  22 lines

  1. /*
  2.  * strpbrk - find first occurrence of any char from breakat in s
  3.  */
  4.  
  5. #define  NULL      0
  6.  
  7. char *                                 /* found char, or NULL if none */
  8. strpbrk(s, breakat)
  9. CONST char *s;
  10. CONST char *breakat;
  11. {
  12.          register CONST char *sscan;
  13.          register CONST char *bscan;
  14.  
  15.          for (sscan = s; *sscan != '\0'; sscan++) {
  16.                    for (bscan = breakat; *bscan != '\0';)  /* ++ moved down. */
  17.                              if (*sscan == *bscan++)
  18.                                        return(sscan);
  19.          }
  20.          return(NULL);
  21. }
  22.