mirror of https://github.com/aria2/aria2
2009-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use Util::parseLLInt instead of sscanf for portability. The conversion "%Lu" fails in Mac OSX which requires "%llu" instead. * src/FtpConnection.ccpull/1/head
parent
0fc900c0ac
commit
56366759fc
|
@ -1,3 +1,9 @@
|
||||||
|
2009-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Use Util::parseLLInt instead of sscanf for portability. The
|
||||||
|
conversion "%Lu" fails in Mac OSX which requires "%llu" instead.
|
||||||
|
* src/FtpConnection.cc
|
||||||
|
|
||||||
2009-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2009-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Fixed the bug that adding 0 length filter to BitfieldMan filters 1
|
Fixed the bug that adding 0 length filter to BitfieldMan filters 1
|
||||||
|
|
|
@ -341,6 +341,7 @@ unsigned int FtpConnection::receiveResponse()
|
||||||
# define LONGLONG_PRINTF "%lld"
|
# define LONGLONG_PRINTF "%lld"
|
||||||
# define ULONGLONG_PRINTF "%llu"
|
# define ULONGLONG_PRINTF "%llu"
|
||||||
# define LONGLONG_SCANF "%Ld"
|
# define LONGLONG_SCANF "%Ld"
|
||||||
|
// Mac OSX uses "%llu" for 64bits integer.
|
||||||
# define ULONGLONG_SCANF "%Lu"
|
# define ULONGLONG_SCANF "%Lu"
|
||||||
#endif // __MINGW32__
|
#endif // __MINGW32__
|
||||||
|
|
||||||
|
@ -349,8 +350,8 @@ unsigned int FtpConnection::receiveSizeResponse(uint64_t& size)
|
||||||
std::pair<unsigned int, std::string> response;
|
std::pair<unsigned int, std::string> response;
|
||||||
if(bulkReceiveResponse(response)) {
|
if(bulkReceiveResponse(response)) {
|
||||||
if(response.first == 213) {
|
if(response.first == 213) {
|
||||||
sscanf(response.second.c_str(), "%*u " ULONGLONG_SCANF,
|
std::pair<std::string, std::string> rp = Util::split(response.second," ");
|
||||||
reinterpret_cast<long long unsigned int*>(&size));
|
size = Util::parseULLInt(rp.second);
|
||||||
}
|
}
|
||||||
return response.first;
|
return response.first;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue