fix some c_str() usage

Fix some cases of c_str() usage.