X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrcpy.c;h=18fc91e16d75c636267badd9ff423a80c15bbddc;hb=41afb7a0762978ee57d1a8d6223e82e73f2acb9b;hp=94f54b40efc730ebd9074deb19d6b249f8d360f1;hpb=96c55f60f49ceb842cf30e0018bb963ef9ed7d1c;p=pdclib.old diff --git a/functions/string/strcpy.c b/functions/string/strcpy.c index 94f54b4..18fc91e 100644 --- a/functions/string/strcpy.c +++ b/functions/string/strcpy.c @@ -1,16 +1,18 @@ -// ---------------------------------------------------------------------------- -// $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; }