From 483754ab27f2a58011f723efa52163a83c63e56e Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sun, 1 Feb 2015 16:50:55 -0500 Subject: lots of stuff --- libc/string.c | 5 +++-- libc/string.h | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 libc/string.h (limited to 'libc') 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 +#include #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; } diff --git a/libc/string.h b/libc/string.h deleted file mode 100644 index 8606fab..0000000 --- a/libc/string.h +++ /dev/null @@ -1,3 +0,0 @@ -#include -int strlen(const char*); -void* memset(void*, int, size_t); -- cgit v1.1