shithub: scc

Download patch

ref: 69b5a8019cbd3df428f00665f56331ee9bdace41
parent: d1475c2e8a729ae33f2f8fd94ad0b54b519ce8c3
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Thu Feb 16 16:49:25 EST 2017

[libc] Add strcat()

--- a/libc/src/Makefile
+++ b/libc/src/Makefile
@@ -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
 
--- /dev/null
+++ b/libc/src/strcat.c
@@ -1,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;
+}