[hackers] [scc] [libc] Add strcat() || Roberto E. Vargas Caballero
commit 6b7f10769a17d19ca3b3e2f3ed4e42d6ca9dd4c2
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Feb 16 21:49:25 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Feb 16 21:49:25 2017 +0100
[libc] Add strcat()
diff --git a/libc/src/Makefile b/libc/src/Makefile
index 43228ab..4d83879 100644
--- a/libc/src/Makefile
+++ b/libc/src/Makefile
_AT_@ -2,7 +2,7 @@
.POSIX:
LIBCOBJ = assert.o strcpy.o strcmp.o strlen.o strchr.o \
- strrchr.o
+ strrchr.o strcat.o
all: libc.a
diff --git a/libc/src/strcat.c b/libc/src/strcat.c
new file mode 100644
index 0000000..86757c9
--- /dev/null
+++ b/libc/src/strcat.c
_AT_@ -0,0 +1,15 @@
+/* See LICENSE file for copyright and license details. */
+
+#include <string.h>
+
+char *
+strcat(char *dst, const char *src)
+{
+ char *ret;
+
+ for (ret = dst; *dst; ++dst)
+ /* nothing */;
+ while (*dst++ = *src++)
+ /* nothing */;
+ return ret;
+}
Received on Thu Feb 16 2017 - 22:09:02 CET
This archive was generated by hypermail 2.3.0
: Thu Feb 16 2017 - 22:12:18 CET