mirror of
https://github.com/UzixLS/KernelEx.git
synced 2025-07-18 23:11:19 +03:00
20 lines
235 B
C
Executable File
20 lines
235 B
C
Executable File
/*
|
|
* memchr.c
|
|
*/
|
|
|
|
#include <stddef.h>
|
|
#include <string.h>
|
|
|
|
void *memchr(const void *s, int c, size_t n)
|
|
{
|
|
const unsigned char *sp = s;
|
|
|
|
while (n--) {
|
|
if (*sp == (unsigned char)c)
|
|
return (void *)sp;
|
|
sp++;
|
|
}
|
|
|
|
return NULL;
|
|
}
|