619afe25da
@update > CMakeLists.txt | remove casiowin-* target (unused) | remove x86-generic target (unused) | update files location | remove old vhex sources files (deprecated, unused) > src/posix | remove this folder > src/libc | move its content to src/ | remove thread module > src/stdlib/reallocarray | check if the multiplication overflow failed | set appropriate errno value if multiplication failed
17 lines
239 B
C
17 lines
239 B
C
#include <string.h>
|
|
|
|
#ifndef __SUPPORT_ARCH_SH
|
|
|
|
void *memchr(void const *_s, int c, size_t n)
|
|
{
|
|
char const *s = _s;
|
|
|
|
for(size_t i = 0; i < n; i++) {
|
|
if(s[i] == c) return (char *)&s[i];
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
#endif /*__SUPPORT_ARCH_SH*/
|