cast the c_str pointer

This commit is contained in:
altalk23 2022-11-22 14:06:00 +03:00 committed by alk
parent caac958c37
commit 2034b3e62d

View file

@ -114,8 +114,8 @@ public:
* it means that you needn't do a release operation unless you retain it.
*/
// Geode change: this is kind of a hack but i think it will work
static inline CCString* create(std::string& str) {
return CCString::createWithData(str.c_str(), str.size());
static inline CCString* create(std::string const& str) {
return CCString::createWithData(reinterpret_cast<unsigned char const*>(str.c_str()), str.size());
}
/** create a string with format, it's similar with the c function 'sprintf', the default buffer size is (1024*100) bytes,