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

Unified Diff: src/conversions.cc

Issue 5338005: Fix number parsing to not allow space between sign and digits. (Closed)
Patch Set: Address review comment. 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..a954d6cc694748e2629451fe816d400ac9c6459d 100644
--- a/src/conversions.cc
+++ b/src/conversions.cc
@@ -448,12 +448,12 @@ static double InternalStringToDouble(Iterator current,
bool sign = false;
if (*current == '+') {
- // Ignore leading sign; skip following spaces.
+ // Ignore leading sign.
++current;
- if (!AdvanceToNonspace(&current, end)) return JUNK_STRING_VALUE;
+ if (current == end) return JUNK_STRING_VALUE;
} 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