summaryrefslogtreecommitdiffstats
path: root/lib/libc-headless/string/memset.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc-headless/string/memset.c')
-rw-r--r--lib/libc-headless/string/memset.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libc-headless/string/memset.c b/lib/libc-headless/string/memset.c
new file mode 100644
index 0000000..f79a4b4
--- /dev/null
+++ b/lib/libc-headless/string/memset.c
@@ -0,0 +1,7 @@
+#include <stddef.h>
+
+void
+memset(void *s, int c, size_t n)
+{
+ for(unsigned char *sb = s; n; n--) *(sb++) = c;
+}