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

Unified Diff: base/string_util.cc

Issue 6894037: Add more information to about:version and "About Chromium" dialog (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 8 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 | « no previous file | base/string_util_unittest.cc » ('j') | chrome/app/generated_resources.grd » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util.cc
diff --git a/base/string_util.cc b/base/string_util.cc
index 1ad9abe5d8396f20dcefd5170aedf4e5644391ef..0cbb25fcb8c06354af111a6af0f2096b18e2ab2c 100644
--- a/base/string_util.cc
+++ b/base/string_util.cc
@@ -831,7 +831,6 @@ template<class FormatStringType, class OutStringType>
OutStringType DoReplaceStringPlaceholders(const FormatStringType& format_string,
const std::vector<OutStringType>& subst, std::vector<size_t>* offsets) {
size_t substitutions = subst.size();
- DCHECK(substitutions < 10);
size_t sub_length = 0;
for (typename std::vector<OutStringType>::const_iterator iter = subst.begin();
@@ -856,7 +855,14 @@ OutStringType DoReplaceStringPlaceholders(const FormatStringType& format_string,
}
--i;
} else {
- uintptr_t index = *i - '1';
+ uintptr_t index = 0;
+ while ('0' <= *i && '9' >= *i) {
+ index *= 10;
+ index += *i - '0';
+ ++i;
+ }
+ --i;
+ index -= 1;
if (offsets) {
ReplacementOffset r_offset(index,
static_cast<int>(formatted.size()));
« no previous file with comments | « no previous file | base/string_util_unittest.cc » ('j') | chrome/app/generated_resources.grd » ('J')

Powered by Google App Engine
This is Rietveld 408576698