summaryrefslogtreecommitdiff
path: root/lib/string
diff options
context:
space:
mode:
authorstefan <stefan@s00.xyz>2023-04-04 06:01:50 +0000
committerstefan <stefan@s00.xyz>2023-04-04 06:01:50 +0000
commit25108684fe235d4296c3cbc480298df209682586 (patch)
tree59f051e13154764da2b98dfdc1ce66e363d801da /lib/string
parent254ffbc869c2376e77ecc298dfd396f077e9d58a (diff)
downloadsv-25108684fe235d4296c3cbc480298df209682586.tar.gz
build system and some other stuff
Diffstat (limited to 'lib/string')
-rw-r--r--lib/string/memset.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/string/memset.c b/lib/string/memset.c
new file mode 100644
index 0000000..59e3bea
--- /dev/null
+++ b/lib/string/memset.c
@@ -0,0 +1,14 @@
+#include <stddef.h>
+#include <string.h>
+
+void *
+memset(void *s, int c, size_t n)
+{
+ char *xs = s;
+
+ while (n--)
+ *xs++ = c;
+
+ return s;
+}
+