In C it isn't "normal" to return two values. That means that as you already did you could create a struct to return the result. That is the formally correct way of doing it, but not the simplest one and it is coumbersome. So I would totaly forget that solution.
Generically, the other way of returning results is by passing arguments by reference (in Pascal VB etc ).
In C there is not the possibility to pass them by reference instead a pointer is passed.
But in C++ there is the possibility to pass the variable by reference ( that simply means passing the pointer but using the variable ).
So I believe the simplest way of doing what you need is to define:
char* bar(int *lenP); //
now you have the result of a function that could return two results:
like if it was defined as pseudo syntax (s,l)=bar();
Additionally you could also use:
void bar(char * *s,int * lenP); // that case treats equally the too arguments.
In C++ I would use the by reference approach because while being the same from the practical point of view (what the processor does) it is simpler for the programmer.