diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-09-27 00:45:32 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-09-27 00:45:32 +0900 |
| commit | 89f18dde856894eef23dde77a9257655725ba843 (patch) | |
| tree | 73d5ea34e16655e524fd00b807d03450953061b6 /src/FtpConnection.cc | |
| parent | a879d75aaacce6c838b20c3c961b38182a1179b2 (diff) | |
Use nothrow version of parseInt, parseUInt and parseLLInt
Diffstat (limited to 'src/FtpConnection.cc')
| -rw-r--r-- | src/FtpConnection.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/FtpConnection.cc b/src/FtpConnection.cc index 0d64f52b..26d4dacb 100644 --- a/src/FtpConnection.cc +++ b/src/FtpConnection.cc @@ -406,9 +406,10 @@ int FtpConnection::receiveSizeResponse(int64_t& size) if(response.first == 213) { std::pair<Sip, Sip> rp; util::divide(rp, response.second.begin(), response.second.end(), ' '); - size = util::parseLLInt(std::string(rp.second.first, rp.second.second)); - if(size < 0) { - throw DL_ABORT_EX("Size must be positive"); + if(!util::parseLLIntNoThrow(size, std::string(rp.second.first, + rp.second.second)) || + size < 0) { + throw DL_ABORT_EX("Size must be positive integer"); } } return response.first; |
