From: Matthias Kruk Date: Tue, 19 Nov 2019 06:45:26 +0000 (+0900) Subject: Add memset() function to klibc X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=624229be0f15d5b4af6c3ad8aae096864d25396e;p=corax Add memset() function to klibc --- diff --git a/kernel/klibc/string.c b/kernel/klibc/string.c index e3a9224..657d746 100644 --- a/kernel/klibc/string.c +++ b/kernel/klibc/string.c @@ -36,3 +36,14 @@ void* memcpy(void *dst, const void *src, size_t n) return(dst); } + +void* memset(void *dst, int val, u32_t n) +{ + char *ptr; + + ptr = dst; + while(n--) { + *ptr++ = val; + } + return(dst); +}