- // Clear any incoming Safe Clone Allocated warning.
- // Propagating this through to our return would really
- // confuse our caller.
- if (*status==U_SAFECLONE_ALLOCATED_WARNING) {
- *status = U_ZERO_ERROR;
+ if (pBufferSize != NULL) {
+ int32_t inputSize = *pBufferSize;
+ *pBufferSize = 1;
+ if (inputSize == 0) {
+ return NULL; // preflighting for deprecated functionality
+ }
+ }
+ BreakIterator *newBI = ((BreakIterator *)bi)->clone();
+ if (newBI == NULL) {
+ *status = U_MEMORY_ALLOCATION_ERROR;
+ } else {
+ *status = U_SAFECLONE_ALLOCATED_WARNING;