Search for TERMIO_PutChar with the search box below in this forum.
I had 26 hits and some of them did answer your question.
Apart from this issue, your function looks a bit suspicious to me
as it for some inputs returns a non nul terminated string, and for some it writes up to length+1 bytes in the passed in buffer. I would make sure to always 0 terminate string buffers, and to never write more than the passed in length (of course the caller could allocate one byte more for the 0 byte already, but that is not the common way buffer sizes are done).
Daniel