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

Unified Diff: src/conversions.cc

Issue 5338005: Fix number parsing to not allow space between sign and digits. (Closed)
Patch Set: Created 10 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 | « no previous file | test/cctest/test-conversions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/conversions.cc
diff --git a/src/conversions.cc b/src/conversions.cc
index 19fa7773abf6edfedf9c54e9dfdea4674d3919bd..df92706ba5e4a3cdbe3f1ed560040c09e836695a 100644
--- a/src/conversions.cc
+++ b/src/conversions.cc
@@ -450,10 +450,10 @@ static double InternalStringToDouble(Iterator current,
if (*current == '+') {
// Ignore leading sign; skip following spaces.
++current;
- if (!AdvanceToNonspace(&current, end)) return JUNK_STRING_VALUE;
+ if (current == end) return JUNK_STRING_VALUE;
Karl Klose 2010/11/26 12:40:12 Should the comment not be updated to something lik
Lasse Reichstein 2010/11/26 12:46:01 Good catch. I'll just remove "; skip following spa
} else if (*current == '-') {
++current;
- if (!AdvanceToNonspace(&current, end)) return JUNK_STRING_VALUE;
+ if (current == end) return JUNK_STRING_VALUE;
sign = true;
}
« no previous file with comments | « no previous file | test/cctest/test-conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698