X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstring%2Fstrxfrm.c;h=96c29e1c3b876c928ef1aba6b7824b77a6761ae7;hp=6f8a59e9af966ea11ba89894fe96c3d6daafdc89;hb=0a5395faab237ba9008352b0f4bee9659bbd3d5f;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec 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); +} +*/