home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d110 / pdc.lha / Pdc / lib / strpbrk.c < prev    next >
Text File  |  1987-10-28  |  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.