]> pd.if.org Git - pdclib/blob - functions/string/strcat.c
Merged PDPCLIB and Therx code.
[pdclib] / functions / string / strcat.c
1 // ----------------------------------------------------------------------------
2 // $Id$
3 // ----------------------------------------------------------------------------
4 // Public Domain C Library - http://pdclib.sourceforge.net
5 // This code is Public Domain. Use, modify, and redistribute at will.
6 // ----------------------------------------------------------------------------
7
8 char * strcat( char * restrict s1, const char * restrict s2 ) { /* TODO */ };
9
10 /* Therx code
11 {
12     while (*s1)
13     {
14         s1++;
15     }
16     while (*s1++ = *s2++)
17     {
18         // EMPTY
19     }
20     return s1;
21 }
22 */
23
24 /* PDPC code - unreviewed
25 {
26     char *p = s1;
27     
28     while (*p != '\0') p++;
29     while ((*p = *s2) != '\0')
30     {
31         p++;
32         s2++;
33     }
34     return (s1);
35 }
36 */