Implemented some basic libc functions and a text console
This commit is contained in:
13
libc/string/memset.c
Normal file
13
libc/string/memset.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <stddef.h>
|
||||
|
||||
void *memset(void *str, int c, size_t n)
|
||||
{
|
||||
unsigned char val = (unsigned char)c;
|
||||
unsigned char *buf = str;
|
||||
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
buf[i] = val;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
Reference in New Issue
Block a user