banan-os/libc/string/memset.c

9 lines
157 B
C
Raw Normal View History

#include <string.h>
void* memset(void* s, int c, size_t n)
{
unsigned char* p = (unsigned char*)s;
for (size_t i = 0; i < n; i++)
p[i] = c;
return s;
}