summaryrefslogtreecommitdiff
path: root/deps/icu-small/source/common/ucnv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'deps/icu-small/source/common/ucnv.cpp')
-rw-r--r--deps/icu-small/source/common/ucnv.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/deps/icu-small/source/common/ucnv.cpp b/deps/icu-small/source/common/ucnv.cpp
index 39ea5dfa66..abf302eadd 100644
--- a/deps/icu-small/source/common/ucnv.cpp
+++ b/deps/icu-small/source/common/ucnv.cpp
@@ -1743,13 +1743,9 @@ ucnv_fromUChars(UConverter *cnv,
}
if(srcLength>0) {
srcLimit=src+srcLength;
+ destCapacity=pinCapacity(dest, destCapacity);
destLimit=dest+destCapacity;
- /* pin the destination limit to U_MAX_PTR; NULL check is for OS/400 */
- if(destLimit<dest || (destLimit==NULL && dest!=NULL)) {
- destLimit=(char *)U_MAX_PTR(dest);
- }
-
/* perform the conversion */
ucnv_fromUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
destLength=(int32_t)(dest-originalDest);
@@ -1803,13 +1799,9 @@ ucnv_toUChars(UConverter *cnv,
}
if(srcLength>0) {
srcLimit=src+srcLength;
+ destCapacity=pinCapacity(dest, destCapacity);
destLimit=dest+destCapacity;
- /* pin the destination limit to U_MAX_PTR; NULL check is for OS/400 */
- if(destLimit<dest || (destLimit==NULL && dest!=NULL)) {
- destLimit=(UChar *)U_MAX_PTR(dest);
- }
-
/* perform the conversion */
ucnv_toUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
destLength=(int32_t)(dest-originalDest);