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

Unified Diff: chrome/installer/mini_installer/decompress.cc

Issue 1126163003: mini_installer: Change to use _countof rather than base's arraysize macro. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rm stdlib.h includes Created 5 years, 7 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 | « chrome/installer/mini_installer/decompress.h ('k') | chrome/installer/mini_installer/mini_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/mini_installer/decompress.cc
diff --git a/chrome/installer/mini_installer/decompress.cc b/chrome/installer/mini_installer/decompress.cc
index ed9098a85211d735ed004ba4f6f02e48e55b1d0e..eaec28d6bf61cf23b773b590c2a380b794a524fc 100644
--- a/chrome/installer/mini_installer/decompress.cc
+++ b/chrome/installer/mini_installer/decompress.cc
@@ -190,13 +190,14 @@ bool InitializeFdi() {
L"C:\\Windows\\system32\\cabinet.dll",
};
- wchar_t path[MAX_PATH] = {0};
- for (int i = 0; i < arraysize(candidate_paths); ++i) {
+ static const DWORD kBufferSize = MAX_PATH;
+ wchar_t path[kBufferSize];
+ for (const wchar_t* candidate_path : candidate_paths) {
path[0] = L'\0';
- DWORD result = ::ExpandEnvironmentStringsW(candidate_paths[i],
- path, arraysize(path));
+ DWORD result = ::ExpandEnvironmentStringsW(candidate_path,
+ path, kBufferSize);
- if (result > 0 && result <= arraysize(path))
+ if (result > 0 && result <= kBufferSize)
g_fdi = ::LoadLibraryExW(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
if (g_fdi)
« no previous file with comments | « chrome/installer/mini_installer/decompress.h ('k') | chrome/installer/mini_installer/mini_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698