]> pd.if.org Git - pdclib/blob - functions/string/strcpy.c
Merged PDPCLIB and Therx code.
[pdclib] / functions / string / strcpy.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 * strcpy( char * restrict s1, const char * restrict s2 ) { /* TODO */ };
9
10 /* Therx code - unreviewed
11 {
12     while (*s1++ = *s2++)
13     {
14         // EMPTY
15     }
16     return s1;
17 }
18 */
19
20 /* PDPC code - unreviewed
21 char *strcpy(char *s1, const char *s2)
22 {
23     char *p = s1;
24     
25     while ((*p++ = *s2++) != '\0') ;
26     return (s1);
27 }
28 */