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

Unified Diff: net/ftp/ftp_directory_listing_parser_mlsd.cc

Issue 3968001: Update code that previously constructed strings from string iterators only to... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 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
Index: net/ftp/ftp_directory_listing_parser_mlsd.cc
===================================================================
--- net/ftp/ftp_directory_listing_parser_mlsd.cc (revision 63369)
+++ net/ftp/ftp_directory_listing_parser_mlsd.cc (working copy)
@@ -28,15 +28,23 @@
if (text.length() < 14)
return false;
- if (!base::StringToInt(text.substr(0, 4), &time_exploded.year))
+ if (!base::StringToInt(text.begin(), text.begin() + 4, &time_exploded.year))
return false;
- if (!base::StringToInt(text.substr(4, 2), &time_exploded.month))
+ if (!base::StringToInt(text.begin() + 4,
+ text.begin() + 6,
+ &time_exploded.month))
return false;
- if (!base::StringToInt(text.substr(6, 2), &time_exploded.day_of_month))
+ if (!base::StringToInt(text.begin() + 6,
+ text.begin() + 8,
+ &time_exploded.day_of_month))
return false;
- if (!base::StringToInt(text.substr(8, 2), &time_exploded.hour))
+ if (!base::StringToInt(text.begin() + 8,
+ text.begin() + 10,
+ &time_exploded.hour))
return false;
- if (!base::StringToInt(text.substr(10, 2), &time_exploded.minute))
+ if (!base::StringToInt(text.begin() + 10,
+ text.begin() + 12,
+ &time_exploded.minute))
return false;
// We don't know the time zone of the server, so just use local time.

Powered by Google App Engine
This is Rietveld 408576698