X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrcpy.c;h=94f54b40efc730ebd9074deb19d6b249f8d360f1;hb=08bc962a1af74ae105cca90328b2f28fb483f04f;hp=1cc1c8e9eedfbec677d2008949211770da261d71;hpb=dcc8a8e99f69e090a03b7b868443addbc0817820;p=pdclib.old diff --git a/functions/string/strcpy.c b/functions/string/strcpy.c index 1cc1c8e..94f54b4 100644 --- a/functions/string/strcpy.c +++ b/functions/string/strcpy.c @@ -5,4 +5,12 @@ // This code is Public Domain. Use, modify, and redistribute at will. // ---------------------------------------------------------------------------- -char * strcpy( char * restrict s1, const char * restrict s2 ) { /* TODO */ }; +char * strcpy( char * restrict dest, const char * restrict src ) +{ + char * tmp = dest; + while ( ( *dest++ = *src++ ) != '\0' ) + { + // EMPTY + } + return tmp; +}