diff options
author | Narayan Kamath <narayan@google.com> | 2014-07-30 17:42:02 +0100 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2014-07-31 13:13:58 +0100 |
commit | 4e4b93ffe988b0a597835d852489573b57e0f3fe (patch) | |
tree | 62c2ff9d3e5f085540e350e6db17ed14e888a2a9 /luni/src/main/native | |
parent | 4f18e98ed6890e5de18e04492efd693d19ce7017 (diff) | |
download | libcore-4e4b93ffe988b0a597835d852489573b57e0f3fe.zip libcore-4e4b93ffe988b0a597835d852489573b57e0f3fe.tar.gz libcore-4e4b93ffe988b0a597835d852489573b57e0f3fe.tar.bz2 |
Don't account buffer.arrayOffset() twice.
data[OUTPUT_OFFSET] from the perspective of native
code must always be the offset from the start of the
buffer passed in to it.
Change-Id: I4a5c9595aebd105c57ce2239dc95cf85d5bd6256
Diffstat (limited to 'luni/src/main/native')
-rw-r--r-- | luni/src/main/native/libcore_icu_NativeConverter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/luni/src/main/native/libcore_icu_NativeConverter.cpp b/luni/src/main/native/libcore_icu_NativeConverter.cpp index 6a85a88..8dd439a 100644 --- a/luni/src/main/native/libcore_icu_NativeConverter.cpp +++ b/luni/src/main/native/libcore_icu_NativeConverter.cpp @@ -214,7 +214,7 @@ static jint NativeConverter_encode(JNIEnv* env, jclass, jlong address, UErrorCode errorCode = U_ZERO_ERROR; ucnv_fromUnicode(cnv , &cTarget, cTargetLimit, &mySource, mySourceLimit, NULL, (UBool) flush, &errorCode); *sourceOffset = (mySource - uSource.get()) - *sourceOffset; - *targetOffset = (reinterpret_cast<jbyte*>(cTarget) - uTarget.get()) - *targetOffset; + *targetOffset = (reinterpret_cast<jbyte*>(cTarget) - uTarget.get()); // If there was an error, count the problematic characters. if (errorCode == U_ILLEGAL_CHAR_FOUND || errorCode == U_INVALID_CHAR_FOUND || |