reverse nullterminted string