X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrcpy.c;h=cec5c25192b215462aec0b0d762d4994476b7415;hb=c0169638bd02098717cb23fbbca3bcc4e4caccf0;hp=94f54b40efc730ebd9074deb19d6b249f8d360f1;hpb=19b4cc9a30c2ede7a0cd6c417b5f26851376b708;p=pdclib diff --git a/functions/string/strcpy.c b/functions/string/strcpy.c index 94f54b4..cec5c25 100644 --- a/functions/string/strcpy.c +++ b/functions/string/strcpy.c @@ -1,16 +1,20 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* $Id$ */ -char * strcpy( char * restrict dest, const char * restrict src ) +/* 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 * tmp = dest; - while ( ( *dest++ = *src++ ) != '\0' ) - { - // EMPTY - } - return tmp; + char * rc = s1; + while ( ( *s1++ = *s2++ ) ); + return rc; } + +#warning Test driver missing.