Closed debug064 closed 10 years ago
I guess this has something to do with MSVC++ not implementing the C99 standard, in which the %hh length modifier was introduced. i created a new branch with a workaround for that, but i have no access to said msvc compiler to actually test it. Maybe you like to test it and tell me, whether it works or not.
It works.
Just in case here are the changes I also made in local version. in header file: ordered windows header
Removed using namespace std;
In cpp file Removed defines windows.h and winsock.h
in ftplib::readline added
end = static_cast<char*>(_memccpy(bp, ctl->cget, '\n', x));
end = static_cast<char*>(memccpy(bp,ctl->cget,'\n',x));
in ftplib::Connect added
lhost = _strdup(host);
lhost = strdup(host);
Thank you, i could reproduce the problem on an msvc 2012 environment, too (plus the _memccpy & _strdup issues). i will merge the fix to master.
It happens in this line: sscanf(cp,"%hhu,%hhu,%hhu,%hhu,%hhu,%hhu",&v[2],&v[3],&v[4],&v[5],&v[0],&v[1]); If change unsigned char v[6]; to unsigned int v[6]; then it works.
In GCC 4.8.1.it works fine.