summaryrefslogtreecommitdiff
path: root/rushs/tinyprintf/my_memset
diff options
context:
space:
mode:
Diffstat (limited to 'rushs/tinyprintf/my_memset')
-rw-r--r--rushs/tinyprintf/my_memset/my_memset.c12
-rw-r--r--rushs/tinyprintf/my_memset/my_memset.h6
2 files changed, 18 insertions, 0 deletions
diff --git a/rushs/tinyprintf/my_memset/my_memset.c b/rushs/tinyprintf/my_memset/my_memset.c
new file mode 100644
index 0000000..243a5ac
--- /dev/null
+++ b/rushs/tinyprintf/my_memset/my_memset.c
@@ -0,0 +1,12 @@
+#include "my_memset.h"
+
+void *my_memset(void *s, int c, size_t n)
+{
+ unsigned char *t = s;
+ for (size_t i = 0; i < n; i++)
+ {
+ t[i] = c;
+ }
+
+ return t;
+}
diff --git a/rushs/tinyprintf/my_memset/my_memset.h b/rushs/tinyprintf/my_memset/my_memset.h
new file mode 100644
index 0000000..e5ed0f0
--- /dev/null
+++ b/rushs/tinyprintf/my_memset/my_memset.h
@@ -0,0 +1,6 @@
+#ifndef MY_MEMSET_H
+#define MY_MEMSET_H
+
+#include <stddef.h>
+
+#endif /* ! MY_MEMSET_H */