1.2 working program: reverse null-terminated str