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

Unified Diff: source/tools/toolutil/package.cpp

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 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/tools/toolutil/package.h ('k') | source/tools/toolutil/pkg_genc.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/tools/toolutil/package.cpp
diff --git a/source/tools/toolutil/package.cpp b/source/tools/toolutil/package.cpp
index e8d7bf7d1ecefc0d6e8e023a45e850247ee8169a..658053912539a2e0af3360ca6cf8e1cfad4ce8e7 100644
--- a/source/tools/toolutil/package.cpp
+++ b/source/tools/toolutil/package.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2013, International Business Machines
+* Copyright (C) 1999-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -42,8 +42,6 @@ static const int32_t kItemsChunk = 256; /* How much to increase the filesarray b
// general definitions ----------------------------------------------------- ***
-#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
-
/* UDataInfo cf. udata.h */
static const UDataInfo dataInfo={
(uint16_t)sizeof(UDataInfo),
@@ -594,7 +592,7 @@ Package::readPackage(const char *filename) {
exit(U_INVALID_FORMAT_ERROR);
}
prefixLength=(int32_t)(prefixLimit-s);
- if(prefixLength==0 || prefixLength>=LENGTHOF(pkgPrefix)) {
+ if(prefixLength==0 || prefixLength>=UPRV_LENGTHOF(pkgPrefix)) {
fprintf(stderr,
"icupkg: --auto_toc_prefix[_with_type] but "
"the prefix of the first entry \"%s\" is empty or too long\n",
@@ -609,6 +607,7 @@ Package::readPackage(const char *filename) {
exit(U_INVALID_FORMAT_ERROR);
}
memcpy(pkgPrefix, s, prefixLength);
+ pkgPrefix[prefixLength]=0;
memcpy(prefix, s, ++prefixLength); // include the /
} else {
// Use the package basename as prefix.
« no previous file with comments | « source/tools/toolutil/package.h ('k') | source/tools/toolutil/pkg_genc.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698