rawmemchr.c 438 B

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