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

Unified Diff: net/http/http_chunked_decoder.cc

Issue 8921006: Standardize StringToInt{,64} interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix call syntax of StringToInt() in Chrome OS code. Created 9 years 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 | « net/ftp/ftp_util.cc ('k') | net/http/http_response_headers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_chunked_decoder.cc
diff --git a/net/http/http_chunked_decoder.cc b/net/http/http_chunked_decoder.cc
index d5b16ddb6ea738ae4530e7d33b74ba06de66f336..917ac494752767496f16d49245a0c90f5c29ff1b 100644
--- a/net/http/http_chunked_decoder.cc
+++ b/net/http/http_chunked_decoder.cc
@@ -187,12 +187,14 @@ bool HttpChunkedDecoder::ParseChunkSize(const char* start, int len, int* out) {
// Be more restrictive than HexStringToInt;
// don't allow inputs with leading "-", "+", "0x", "0X"
- if (base::StringPiece(start, len).find_first_not_of("0123456789abcdefABCDEF")
- != base::StringPiece::npos)
+ base::StringPiece chunk_size(start, len);
+ if (chunk_size.find_first_not_of("0123456789abcdefABCDEF")
+ != base::StringPiece::npos) {
return false;
+ }
int parsed_number;
- bool ok = base::HexStringToInt(start, start + len, &parsed_number);
+ bool ok = base::HexStringToInt(chunk_size, &parsed_number);
if (ok && parsed_number >= 0) {
*out = parsed_number;
return true;
« no previous file with comments | « net/ftp/ftp_util.cc ('k') | net/http/http_response_headers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698