reverse null terminated string