[hackers] [scc] [libc] Add strcpy() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 16 Feb 2017 21:24:56 +0100 (CET)

commit 8983432321fac3cb410bb19beae46d891c438328
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Feb 16 20:53:38 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Feb 16 20:53:38 2017 +0100

    [libc] Add strcpy()

diff --git a/libc/src/Makefile b/libc/src/Makefile
index d837948..fc94ea8 100644
--- a/libc/src/Makefile
+++ b/libc/src/Makefile
_AT_@ -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) $_AT_ $?
diff --git a/libc/src/strcpy.c b/libc/src/strcpy.c
new file mode 100644
index 0000000..9e38335
--- /dev/null
+++ b/libc/src/strcpy.c
_AT_@ -0,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;
+}
Received on Thu Feb 16 2017 - 21:24:56 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 16 2017 - 21:36:22 CET