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
pull/1/head
Tatsuhiro Tsujikawa 2009-02-11 10:32:10 +00:00
parent 0fc900c0ac
commit 56366759fc
2 changed files with 9 additions and 2 deletions

View File

@ -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>
Fixed the bug that adding 0 length filter to BitfieldMan filters 1

View File

@ -341,6 +341,7 @@ unsigned int FtpConnection::receiveResponse()
# define LONGLONG_PRINTF "%lld"
# define ULONGLONG_PRINTF "%llu"
# define LONGLONG_SCANF "%Ld"
// Mac OSX uses "%llu" for 64bits integer.
# define ULONGLONG_SCANF "%Lu"
#endif // __MINGW32__
@ -349,8 +350,8 @@ unsigned int FtpConnection::receiveSizeResponse(uint64_t& size)
std::pair<unsigned int, std::string> response;
if(bulkReceiveResponse(response)) {
if(response.first == 213) {
sscanf(response.second.c_str(), "%*u " ULONGLONG_SCANF,
reinterpret_cast<long long unsigned int*>(&size));
std::pair<std::string, std::string> rp = Util::split(response.second," ");
size = Util::parseULLInt(rp.second);
}
return response.first;
} else {