X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrxfrm.c;h=96c29e1c3b876c928ef1aba6b7824b77a6761ae7;hb=e5456e3c2697c4e17fc9aa3439f2e305517b4d96;hp=6f8a59e9af966ea11ba89894fe96c3d6daafdc89;hpb=dcc8a8e99f69e090a03b7b868443addbc0817820;p=pdclib.old diff --git a/functions/string/strxfrm.c b/functions/string/strxfrm.c index 6f8a59e..96c29e1 100644 --- a/functions/string/strxfrm.c +++ b/functions/string/strxfrm.c @@ -6,3 +6,17 @@ // ---------------------------------------------------------------------------- size_t strxfrm( char * restrict s1, const char * restrict s2, size_t n ) { /* TODO */ }; + +/* PDPC code - unreviewed +{ + size_t oldlen; + + oldlen = strlen(s2); + if (oldlen < n) + { + memcpy(s1, s2, oldlen); + s1[oldlen] = '\0'; + } + return (oldlen); +} +*/