strchrnul.c 508 B

123456789101112131415161718192021222324252627
  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 __USE_GNU
  9. #ifdef WANT_WIDE
  10. # define Wstrchrnul wcschrnul
  11. #else
  12. # define Wstrchrnul strchrnul
  13. #endif
  14. libc_hidden_proto(Wstrchrnul)
  15. Wchar *Wstrchrnul(register const Wchar *s, Wint c)
  16. {
  17. --s;
  18. while (*++s && (*s != ((Wchar)c)));
  19. return (Wchar *) s;
  20. }
  21. libc_hidden_def(Wstrchrnul)
  22. #endif