Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(451)

Unified Diff: source/test/intltest/winutil.cpp

Issue 285520043: ticket:12012: Replace all sizeof p / sizeof *p with UPRV_LENGTHOF(). (Closed) Base URL: svn+ssh://source.icu-project.org/repos/icu/icu/trunk
Patch Set: Code review. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/test/intltest/winnmtst.cpp ('k') | source/test/iotest/filetst.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/test/intltest/winutil.cpp
diff --git a/source/test/intltest/winutil.cpp b/source/test/intltest/winutil.cpp
index ef51fdd53ad453936654aad0ddd9030c588c6888..2f47ad7829fac287758ec6ea46a73dc95c812a25 100644
--- a/source/test/intltest/winutil.cpp
+++ b/source/test/intltest/winutil.cpp
@@ -1,6 +1,6 @@
/*
********************************************************************************
-* Copyright (C) 2005-2013, International Business Machines
+* Copyright (C) 2005-2016, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
@@ -15,6 +15,7 @@
#if !UCONFIG_NO_FORMATTING
+#include "cmemory.h"
#include "winutil.h"
#include "locmap.h"
#include "unicode/uloc.h"
@@ -53,7 +54,7 @@ BOOL CALLBACK EnumLocalesProc(LPSTR lpLocaleString)
sscanf(lpLocaleString, "%8x", &lcidRecords[lcidCount].lcid);
- localeIDLen = uprv_convertToPosix(lcidRecords[lcidCount].lcid, localeID, sizeof(localeID)/sizeof(localeID[0]), &status);
+ localeIDLen = uprv_convertToPosix(lcidRecords[lcidCount].lcid, localeID, UPRV_LENGTHOF(localeID), &status);
if (U_SUCCESS(status)) {
lcidRecords[lcidCount].localeID = new char[localeIDLen + 1];
memcpy(lcidRecords[lcidCount].localeID, localeID, localeIDLen);
« no previous file with comments | « source/test/intltest/winnmtst.cpp ('k') | source/test/iotest/filetst.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b