diff options
Diffstat (limited to 'net/base/net_util.cc')
-rw-r--r-- | net/base/net_util.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 45dc60c..8f6b2af 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -1676,10 +1676,11 @@ void SetExplicitlyAllowedPorts(const std::string& allowed_ports) { (allowed_ports[i] != kComma)) return; if (i == size || allowed_ports[i] == kComma) { - size_t length = i - last; - if (length > 0) { + if (i > last) { int port; - base::StringToInt(allowed_ports.substr(last, length), &port); + base::StringToInt(allowed_ports.begin() + last, + allowed_ports.begin() + i, + &port); ports.insert(port); } last = i + 1; |