diff options
Diffstat (limited to 'libc/string.c')
| -rw-r--r-- | libc/string.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libc/string.c b/libc/string.c new file mode 100644 index 0000000..33ccad9 --- /dev/null +++ b/libc/string.c @@ -0,0 +1,19 @@ +#include <stdint.h> +#include "string.h" + +int strlen(const char *str) +{ + int len = 0; + while(s++) + len++; + return len; +} + +void* memset(void *buf, int val, size_t sz) +{ + for(size_t i = 0; i < sz; ++i) + { + buf[i] = (uint8_t) val; + } + return buf; +} |