diff --git a/cocos/base/ccUTF8.cpp b/cocos/base/ccUTF8.cpp index aad736e2ed..4ac099fbfa 100644 --- a/cocos/base/ccUTF8.cpp +++ b/cocos/base/ccUTF8.cpp @@ -183,8 +183,6 @@ long getCharacterCountInUTF8String(const std::string& utf8) return getUTF8StringLength((const UTF8*)utf8.c_str()); } - - } //namespace StringUtils { diff --git a/cocos/network/HttpClient-android.cpp b/cocos/network/HttpClient-android.cpp index 28852fd614..4a813af923 100644 --- a/cocos/network/HttpClient-android.cpp +++ b/cocos/network/HttpClient-android.cpp @@ -585,9 +585,9 @@ private: std::string strValue = ""; if (!cocos2d::StringUtils::getUTFCharsFromJavaEnv(env, jstr, strValue)) { - ret = strdup(strValue.c_str()); + strValue = ""; } - + ret = strdup(strValue.c_str()); return ret; }