diff options
Diffstat (limited to 'libc/string.c')
| -rw-r--r-- | libc/string.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libc/string.c b/libc/string.c index 33ccad9..8a9e422 100644 --- a/libc/string.c +++ b/libc/string.c @@ -1,10 +1,11 @@ #include <stdint.h> +#include <stddef.h> #include "string.h" int strlen(const char *str) { int len = 0; - while(s++) + while(*str++) len++; return len; } @@ -13,7 +14,7 @@ void* memset(void *buf, int val, size_t sz) { for(size_t i = 0; i < sz; ++i) { - buf[i] = (uint8_t) val; + ((uint8_t*)buf)[i] = (uint8_t) val; } return buf; } |