1 // Copyright 2016 The Fuchsia Authors
2 // Copyright (c) 2008 Travis Geiselbrecht
3 //
4 // Use of this source code is governed by a MIT-style
5 // license that can be found in the LICENSE file or at
6 // https://opensource.org/licenses/MIT
7 
8 #include <libc/string.h>
9 #include <libc/ctype.h>
10 
memscan(void * addr,int c,size_t size)11 void *memscan(void *addr, int c, size_t size)
12 {
13     unsigned char *p = (unsigned char *)addr;
14 
15     while (size) {
16         if (*p == c)
17             return (void *)p;
18         p++;
19         size--;
20     }
21     return (void *)p;
22 }
23