X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrcpy.c;h=03b8563393f53d141a99b6109fd4c681fb1c341f;hb=e5456e3c2697c4e17fc9aa3439f2e305517b4d96;hp=1cc1c8e9eedfbec677d2008949211770da261d71;hpb=dcc8a8e99f69e090a03b7b868443addbc0817820;p=pdclib.old diff --git a/functions/string/strcpy.c b/functions/string/strcpy.c index 1cc1c8e..03b8563 100644 --- a/functions/string/strcpy.c +++ b/functions/string/strcpy.c @@ -6,3 +6,23 @@ // ---------------------------------------------------------------------------- char * strcpy( char * restrict s1, const char * restrict s2 ) { /* TODO */ }; + +/* Therx code - unreviewed +{ + while (*s1++ = *s2++) + { + // EMPTY + } + return s1; +} +*/ + +/* PDPC code - unreviewed +char *strcpy(char *s1, const char *s2) +{ + char *p = s1; + + while ((*p++ = *s2++) != '\0') ; + return (s1); +} +*/ \ No newline at end of file