Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: source/i18n/fpositer.cpp

Issue 2440913002: Update ICU to 58.1
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/i18n/fphdlimp.cpp ('k') | source/i18n/funcrepl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/fpositer.cpp
diff --git a/source/i18n/fpositer.cpp b/source/i18n/fpositer.cpp
index 3481252a6e3b2bb05d29665c258d044642064580..eb405f9c348ccf620a82b78b2efa52072fe95e00 100644
--- a/source/i18n/fpositer.cpp
+++ b/source/i18n/fpositer.cpp
@@ -1,3 +1,5 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
* Copyright (C) 2009-2012, International Business Machines Corporation and
@@ -60,7 +62,10 @@ void FieldPositionIterator::setData(UVector32 *adopt, UErrorCode& status) {
// Verify that adopt has valid data, and update status if it doesn't.
if (U_SUCCESS(status)) {
if (adopt) {
- if ((adopt->size() % 3) != 0) {
+ if (adopt->size() == 0) {
+ delete adopt;
+ adopt = NULL;
+ } else if ((adopt->size() % 3) != 0) {
status = U_ILLEGAL_ARGUMENT_ERROR;
} else {
for (int i = 1; i < adopt->size(); i += 3) {
« no previous file with comments | « source/i18n/fphdlimp.cpp ('k') | source/i18n/funcrepl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698