tell us tell us tell us what it is.
the function that the other anon gave isn't well thought out and would probably result in a memory leak or bad alloc.
this guy probably knows the history of all that. He's a big booster for Poland and all things about Poland.
he passed a pointer, returns a pointer.
uses the passed pointer to modify the first string, and then returns what is also a pointer, so that would mean that it will set the return pointer to the one passed in. And so then you wouldn't need to do that copy at the return.
anon suggests that anyone manipulating strings in C use the CPP standard template library vector and container classes, especially the one named 'string' (It's been a while but I think there is such a class)