]> git.corax.cc Git - corax/commitdiff
Add memset() function to klibc
authorMatthias Kruk <m@m10k.eu>
Tue, 19 Nov 2019 06:45:26 +0000 (15:45 +0900)
committerMatthias Kruk <m@m10k.eu>
Tue, 19 Nov 2019 06:45:26 +0000 (15:45 +0900)
kernel/klibc/string.c

index e3a92242102bf03736d5ec47a910671a660c0544..657d7460dfe7c7de1aee40ed312cbe2efe9f0dd6 100644 (file)
@@ -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);
+}