summaryrefslogtreecommitdiff
path: root/src/FtpConnection.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-09-27 00:45:32 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-09-27 00:45:32 +0900
commit89f18dde856894eef23dde77a9257655725ba843 (patch)
tree73d5ea34e16655e524fd00b807d03450953061b6 /src/FtpConnection.cc
parenta879d75aaacce6c838b20c3c961b38182a1179b2 (diff)
Use nothrow version of parseInt, parseUInt and parseLLInt
Diffstat (limited to 'src/FtpConnection.cc')
-rw-r--r--src/FtpConnection.cc7
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;