summaryrefslogtreecommitdiff
path: root/src/FtpConnection.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-12-07 22:57:34 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-12-09 21:39:43 +0900
commit12988e5282ef52a2806cbaca9f4074698f35e399 (patch)
tree7a8d5a65a8e8478ba5855e84a1077baee1a2028d /src/FtpConnection.cc
parentf25e67b0178511b26d55642f215a095321a169a8 (diff)
Replaced uint64_t with off_t or int64_t.
Since off_t is int64_t with LFS, we cannot take advantage of extra capacity of uint64_t.
Diffstat (limited to 'src/FtpConnection.cc')
-rw-r--r--src/FtpConnection.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/FtpConnection.cc b/src/FtpConnection.cc
index 90e430c4..4436d7c0 100644
--- a/src/FtpConnection.cc
+++ b/src/FtpConnection.cc
@@ -400,14 +400,17 @@ unsigned int FtpConnection::receiveResponse()
# define ULONGLONG_SCANF "%Lu"
#endif // __MINGW32__
-unsigned int FtpConnection::receiveSizeResponse(uint64_t& size)
+unsigned int FtpConnection::receiveSizeResponse(off_t& size)
{
std::pair<unsigned int, std::string> response;
if(bulkReceiveResponse(response)) {
if(response.first == 213) {
std::pair<Sip, Sip> rp;
util::divide(rp, response.second.begin(), response.second.end(), ' ');
- size = util::parseULLInt(std::string(rp.second.first, rp.second.second));
+ size = util::parseLLInt(std::string(rp.second.first, rp.second.second));
+ if(size < 0) {
+ throw DL_ABORT_EX("Size must be positive");
+ }
}
return response.first;
} else {