summaryrefslogtreecommitdiff
path: root/lib/libc/string/strcat.c
blob: f7267f00bebdc83f81ac012f59fe06a9d063de4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <string.h> // for strcat

char *strcat(char *restrict s1, const char *restrict s2)
{
	char *d = s1;

	while (*d)
		d++;

	while (*s2)
		*d++ = *s2++;

	*d = '\0';

	return s1;
}