Avoid c_str and use std::string rather than char[] buffers