rawmemchr.c 461 B

123456789101112131415161718192021
  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. libc_hidden_proto(rawmemchr)
  10. void *rawmemchr(const void *s, int c)
  11. {
  12. register const unsigned char *r = s;
  13. while (*r != ((unsigned char)c)) ++r;
  14. return (void *) r; /* silence the warning */
  15. }
  16. libc_hidden_def(rawmemchr)
  17. #endif