X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrcpy.c;h=94f54b40efc730ebd9074deb19d6b249f8d360f1;hb=19b4cc9a30c2ede7a0cd6c417b5f26851376b708;hp=1cc1c8e9eedfbec677d2008949211770da261d71;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec;p=pdclib 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; +}