strchrnul.c 483 B

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