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