summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/icu-src/source/common/ubrk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/icu/icu-src/source/common/ubrk.cpp')
-rw-r--r--Build/source/libs/icu/icu-src/source/common/ubrk.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/Build/source/libs/icu/icu-src/source/common/ubrk.cpp b/Build/source/libs/icu/icu-src/source/common/ubrk.cpp
index bb5bdd1b501..f4e064961f3 100644
--- a/Build/source/libs/icu/icu-src/source/common/ubrk.cpp
+++ b/Build/source/libs/icu/icu-src/source/common/ubrk.cpp
@@ -168,7 +168,7 @@ ubrk_safeClone(
BreakIterator *newBI = ((BreakIterator *)bi)->clone();
if (newBI == NULL) {
*status = U_MEMORY_ALLOCATION_ERROR;
- } else {
+ } else if (pBufferSize != NULL) {
*status = U_SAFECLONE_ALLOCATED_WARNING;
}
return (UBreakIterator *)newBI;
@@ -176,15 +176,7 @@ ubrk_safeClone(
U_CAPI UBreakIterator * U_EXPORT2
ubrk_clone(const UBreakIterator *bi, UErrorCode *status) {
- if (U_FAILURE(*status)) {
- return nullptr;
- }
- BreakIterator *newBI = ((BreakIterator *)bi)->clone();
- if (newBI == nullptr) {
- *status = U_MEMORY_ALLOCATION_ERROR;
- return nullptr;
- }
- return (UBreakIterator *)newBI;
+ return ubrk_safeClone(bi, nullptr, nullptr, status);
}