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

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

Issue 6533009: Switch from wcsftime to GetDateFormat to avoid crash in setup.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/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 74952)
+++ chrome/installer/util/install_util.cc (working copy)
@@ -263,3 +263,12 @@
*command_line = CommandLine::FromString(command);
}
}
+
+std::wstring InstallUtil::GetCurrentDate() {
+ wchar_t date_str[10] = {0};
grt (UTC plus 2) 2011/02/17 04:04:10 Why 10?
tommi (sloooow) - chröme 2011/02/17 19:40:09 nervousness around yyyyy
+ const wchar_t kDateFormat[] = L"yyyyMMdd";
grt (UTC plus 2) 2011/02/17 04:04:10 nit: static const?
tommi (sloooow) - chröme 2011/02/17 19:40:09 Done.
+ size_t ret = GetDateFormatW(LOCALE_USER_DEFAULT, 0, NULL, kDateFormat,
grt (UTC plus 2) 2011/02/17 04:04:10 Use LOCALE_INVARIANT. Otherwise, you could potent
grt (UTC plus 2) 2011/02/17 04:04:10 MSDN says GetDateFormat returns an int. If you ch
tommi (sloooow) - chröme 2011/02/17 19:40:09 Done.
+ date_str, arraysize(date_str));
+ DCHECK_EQ(arraysize(kDateFormat), ret);
grt (UTC plus 2) 2011/02/17 04:04:10 MSDN says that 'yyyy' can yield a 5-digit year, wh
tommi (sloooow) - chröme 2011/02/17 19:40:09 Done.
+ return date_str;
grt (UTC plus 2) 2011/02/17 04:04:10 I'm a huge fan of std::wstring(date_str, ret), whi
tommi (sloooow) - chröme 2011/02/17 19:40:09 Done.
+}
« 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