summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/icu-src/source/common/ucnv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/icu/icu-src/source/common/ucnv.cpp')
-rw-r--r--Build/source/libs/icu/icu-src/source/common/ucnv.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Build/source/libs/icu/icu-src/source/common/ucnv.cpp b/Build/source/libs/icu/icu-src/source/common/ucnv.cpp
index 5dcf35e0438..019bcb6a79c 100644
--- a/Build/source/libs/icu/icu-src/source/common/ucnv.cpp
+++ b/Build/source/libs/icu/icu-src/source/common/ucnv.cpp
@@ -252,7 +252,10 @@ ucnv_safeClone(const UConverter* cnv, void *stackBuffer, int32_t *pBufferSize, U
UTRACE_EXIT_STATUS(*status);
return NULL;
}
- *status = U_SAFECLONE_ALLOCATED_WARNING;
+ // If pBufferSize was NULL as the input, pBufferSize is set to &stackBufferSize in this function.
+ if (pBufferSize != &stackBufferSize) {
+ *status = U_SAFECLONE_ALLOCATED_WARNING;
+ }
/* record the fact that memory was allocated */
*pBufferSize = bufferSizeNeeded;
@@ -317,7 +320,11 @@ ucnv_safeClone(const UConverter* cnv, void *stackBuffer, int32_t *pBufferSize, U
return localConverter;
}
-
+U_CAPI UConverter* U_EXPORT2
+ucnv_clone(const UConverter* cnv, UErrorCode *status)
+{
+ return ucnv_safeClone(cnv, nullptr, nullptr, status);
+}
/*Decreases the reference counter in the shared immutable section of the object
*and frees the mutable part*/