diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-12-12 15:08:24 +0100 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-12-12 15:08:24 +0100 |
commit | 674c9666d3405bac361677c72d2fb7c16f31dbad (patch) | |
tree | ea84d2c20955fffda046e6c9dbcd1ac596b47bb2 /luni/src/main/native | |
parent | 3a8f57d2dc82c0879b0e29fbdfaad9b9fb44e6f6 (diff) | |
parent | 1b7c3672b5219216119eb288d4363324a7f6667e (diff) | |
download | libcore-replicant-6.0.zip libcore-replicant-6.0.tar.gz libcore-replicant-6.0.tar.bz2 |
Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_libcore into replicant-6.0HEADreplicant-6.0-0001replicant-6.0
Diffstat (limited to 'luni/src/main/native')
-rw-r--r-- | luni/src/main/native/libcore_icu_NativeIDN.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/luni/src/main/native/libcore_icu_NativeIDN.cpp b/luni/src/main/native/libcore_icu_NativeIDN.cpp index 43f3ce5..9786b9d 100644 --- a/luni/src/main/native/libcore_icu_NativeIDN.cpp +++ b/luni/src/main/native/libcore_icu_NativeIDN.cpp @@ -37,7 +37,8 @@ static jstring NativeIDN_convertImpl(JNIEnv* env, jclass, jstring javaSrc, jint if (src.get() == NULL) { return NULL; } - UChar dst[256]; + static const size_t kDstSize = 512; + UChar dst[kDstSize]; UErrorCode status = U_ZERO_ERROR; // We're stuck implementing IDNA-2003 for now since that's what we specify. @@ -47,10 +48,10 @@ static jstring NativeIDN_convertImpl(JNIEnv* env, jclass, jstring javaSrc, jint #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" size_t resultLength = toAscii - ? uidna_IDNToASCII(src.get(), src.size(), &dst[0], sizeof(dst), flags, NULL, &status) - : uidna_IDNToUnicode(src.get(), src.size(), &dst[0], sizeof(dst), flags, NULL, &status); + ? uidna_IDNToASCII(src.get(), src.size(), &dst[0], kDstSize, flags, NULL, &status) + : uidna_IDNToUnicode(src.get(), src.size(), &dst[0], kDstSize, flags, NULL, &status); #pragma GCC diagnostic pop - + if (U_FAILURE(status)) { jniThrowException(env, "java/lang/IllegalArgumentException", u_errorName(status)); return NULL; |