ref: 4c642e3e66899c12f4de7e7bda7f2b96e122b342
parent: 35433cdb45a12bbbfab1e960a51cf9089b338c05
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Feb 16 15:53:38 EST 2017
[libc] Add strcpy()
--- a/libc/src/Makefile
+++ b/libc/src/Makefile
@@ -1,7 +1,7 @@
# See LICENSE file for copyright and license details.
.POSIX:
-LIBCOBJ = assert.o
+LIBCOBJ = assert.o strcpy.o
libc.a: $(LIBCOJB)
ar $(ARFLAGS) $@ $?
--- /dev/null
+++ b/libc/src/strcpy.c
@@ -1,0 +1,13 @@
+/* See LICENSE file for copyright and license details. */
+
+#include <string.h>
+
+char *
+strcpy(char *dst, const char *src)
+{
+ char *ret = dst;
+
+ while (*dst++ = *src++)
+ /* nothing */;
+ return ret;
+}