Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /* strpbrk( const char *, const char * )
  2.  
  3.    This file is part of the Public Domain C Library (PDCLib).
  4.    Permission is granted to use, modify, and / or redistribute at will.
  5. */
  6.  
  7. #include <string.h>
  8.  
  9. char * strpbrk( const char * s1, const char * s2 )
  10. {
  11.     const char * p1 = s1;
  12.     const char * p2;
  13.  
  14.     while ( *p1 )
  15.     {
  16.         p2 = s2;
  17.  
  18.         while ( *p2 )
  19.         {
  20.             if ( *p1 == *p2++ )
  21.             {
  22.                 return ( char * ) p1;
  23.             }
  24.         }
  25.  
  26.         ++p1;
  27.     }
  28.  
  29.     return NULL;
  30. }