clean up C string wrangling