strpbrk.c 569 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (C) 2002 Manuel Novoa III
  3. * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
  4. *
  5. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. */
  7. #include "_string.h"
  8. #ifdef WANT_WIDE
  9. # define Wstrpbrk wcspbrk
  10. #else
  11. # define Wstrpbrk strpbrk
  12. #endif
  13. Wchar *Wstrpbrk(const Wchar *s1, const Wchar *s2)
  14. {
  15. register const Wchar *s;
  16. register const Wchar *p;
  17. for ( s=s1 ; *s ; s++ ) {
  18. for ( p=s2 ; *p ; p++ ) {
  19. if (*p == *s) return (Wchar *) s; /* silence the warning */
  20. }
  21. }
  22. return NULL;
  23. }
  24. libc_hidden_def(Wstrpbrk)