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

Unified Diff: chrome/common/time_format.cc

Issue 8418034: Make string_util::WriteInto() DCHECK() that the supplied |length_with_null| > 1, meaning that the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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
Index: chrome/common/time_format.cc
===================================================================
--- chrome/common/time_format.cc (revision 107404)
+++ chrome/common/time_format.cc (working copy)
@@ -296,9 +296,9 @@
// With the fallback added, this should never fail.
DCHECK(U_SUCCESS(error));
int capacity = time_string.length() + 1;
+ DCHECK_GT(capacity, 1);
string16 result;
- time_string.extract(static_cast<UChar*>(
- WriteInto(&result, capacity)),
+ time_string.extract(static_cast<UChar*>(WriteInto(&result, capacity)),
capacity, error);
DCHECK(U_SUCCESS(error));
return result;

Powered by Google App Engine
This is Rietveld 408576698