From 4b178c0feb4c415be36be0e4c0def8c447ed42af Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 22 Nov 2019 22:17:54 +0100 Subject: Added the most awesome c lib --- src/mlibc/string/strcpy.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/mlibc/string/strcpy.c (limited to 'src/mlibc/string/strcpy.c') diff --git a/src/mlibc/string/strcpy.c b/src/mlibc/string/strcpy.c new file mode 100644 index 0000000..5a1ff4e --- /dev/null +++ b/src/mlibc/string/strcpy.c @@ -0,0 +1,8 @@ +#include + +void strcpy(char *dest, const char *orig) { + size_t s_orig = strlen(orig); + + for (size_t i = 0; i < s_orig; i++) dest[i] = orig[i]; + dest[s_orig] = 0; +} \ No newline at end of file -- cgit v1.2.3