From 7e517ef6f1154a59473dd6b8a4c3dd39fe5c1360 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Tue, 10 Jul 2018 08:51:12 +0300 Subject: [PATCH] Fix crash in C string conversion, remove excessive includes. (#1786) --- runtime/src/main/cpp/KString.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/runtime/src/main/cpp/KString.cpp b/runtime/src/main/cpp/KString.cpp index 890885b2fba..00a7203263b 100644 --- a/runtime/src/main/cpp/KString.cpp +++ b/runtime/src/main/cpp/KString.cpp @@ -13,16 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include -#include -#include -#include #include -#include - -#include -#include #include "Assert.h" #include "City.h" @@ -713,7 +704,7 @@ int iswlower_Konan(KChar ch) { extern "C" { OBJ_GETTER(CreateStringFromCString, const char* cstring) { - RETURN_RESULT_OF(utf8ToUtf16, cstring, strlen(cstring)); + RETURN_RESULT_OF(utf8ToUtf16, cstring, cstring ? strlen(cstring) : 0); } OBJ_GETTER(CreateStringFromUtf8, const char* utf8, uint32_t lengthBytes) {