X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;ds=sidebyside;f=functions%2Fstring%2Fstrcat.c;h=a0cef0e04267c24607c14e48394f7cadbcb036e7;hb=e5456e3c2697c4e17fc9aa3439f2e305517b4d96;hp=cb0c0a128d83d93cdbd8e3d43229236dc6904fa4;hpb=dcc8a8e99f69e090a03b7b868443addbc0817820;p=pdclib.old diff --git a/functions/string/strcat.c b/functions/string/strcat.c index cb0c0a1..a0cef0e 100644 --- a/functions/string/strcat.c +++ b/functions/string/strcat.c @@ -6,3 +6,31 @@ // ---------------------------------------------------------------------------- char * strcat( char * restrict s1, const char * restrict s2 ) { /* TODO */ }; + +/* Therx code +{ + while (*s1) + { + s1++; + } + while (*s1++ = *s2++) + { + // EMPTY + } + return s1; +} +*/ + +/* PDPC code - unreviewed +{ + char *p = s1; + + while (*p != '\0') p++; + while ((*p = *s2) != '\0') + { + p++; + s2++; + } + return (s1); +} +*/