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

Unified Diff: ui/base/l10n/l10n_util.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, 1 month 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 | « ui/base/clipboard/clipboard_win.cc ('k') | ui/base/win/ime_input.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/l10n/l10n_util.cc
===================================================================
--- ui/base/l10n/l10n_util.cc (revision 111826)
+++ ui/base/l10n/l10n_util.cc (working copy)
@@ -478,12 +478,12 @@
locale_code = "zh-Hant";
UErrorCode error = U_ZERO_ERROR;
- const int buffer_size = 1024;
+ const int kBufferSize = 1024;
string16 display_name;
int actual_size = uloc_getDisplayName(locale_code.c_str(),
display_locale.c_str(),
- WriteInto(&display_name, buffer_size + 1), buffer_size, &error);
+ WriteInto(&display_name, kBufferSize), kBufferSize - 1, &error);
DCHECK(U_SUCCESS(error));
display_name.resize(actual_size);
// Add an RTL mark so parentheses are properly placed.
« no previous file with comments | « ui/base/clipboard/clipboard_win.cc ('k') | ui/base/win/ime_input.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698