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

Unified Diff: chrome/installer/util/install_util.cc

Issue 6532037: Merge 75305 - Switch from wcsftime to GetDateFormat to avoid crash in setup.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/648/src/
Patch Set: Created 9 years, 10 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/util/install_util.h ('k') | chrome/installer/util/install_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/install_util.cc
===================================================================
--- chrome/installer/util/install_util.cc (revision 75311)
+++ chrome/installer/util/install_util.cc (working copy)
@@ -240,3 +240,17 @@
return status;
}
}
+
+std::wstring InstallUtil::GetCurrentDate() {
+ static const wchar_t kDateFormat[] = L"yyyyMMdd";
+ wchar_t date_str[arraysize(kDateFormat)] = {0};
+ int len = GetDateFormatW(LOCALE_INVARIANT, 0, NULL, kDateFormat,
+ date_str, arraysize(date_str));
+ if (len) {
+ --len; // Subtract terminating \0.
+ } else {
+ PLOG(DFATAL) << "GetDateFormat";
+ }
+
+ return std::wstring(date_str, len);
+}
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/install_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698