X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrcpy.c;h=18fc91e16d75c636267badd9ff423a80c15bbddc;hb=f5a3525453c158f6b6091587075b527bd569853d;hp=1cc1c8e9eedfbec677d2008949211770da261d71;hpb=dcc8a8e99f69e090a03b7b868443addbc0817820;p=pdclib.old diff --git a/functions/string/strcpy.c b/functions/string/strcpy.c index 1cc1c8e..18fc91e 100644 --- a/functions/string/strcpy.c +++ b/functions/string/strcpy.c @@ -1,8 +1,18 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- - -char * strcpy( char * restrict s1, const char * restrict s2 ) { /* TODO */ }; +/* $Id$ */ + +/* Release $Name$ */ + +/* strcpy( char *, const char * ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include <_PDCLIB_aux.h> + +char * strcpy( char * _PDCLIB_restrict s1, const char * _PDCLIB_restrict s2 ) +{ + char * rc = s1; + while ( ( *s1++ = *s2++ ) ); + return rc; +}