There is some odd code in there ...
str = --str;
That's nasty ... I really don't recommend that at all. The problem is that what you are using is a side effect operator, and exactly what it will give you is dependant on the compiler writer: Why does x = ++x + x++ give me the wrong answer?
And using a loop that has no terminator is not a good idea.
I'd do it differnetly:
Create a second array of chars the same size as the input buffer plus one char. Put a null in the last element to terminate the string.
Use a loop that continues until it finds a null in the input string.
Place the first character of the input string just before the null you added to the output.
Move on to the next character.
Place the second character of the input string just before the last character you added to the output.
Repeat until you meet the null in the input.
Print the output string from the last position.
Try it on paper, it's a lot simpler than your version!