Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The function ftplib::sprint_rest() is wrong #31

Open
Fojtik opened this issue Apr 29, 2019 · 0 comments
Open

The function ftplib::sprint_rest() is wrong #31

Fojtik opened this issue Apr 29, 2019 · 0 comments

Comments

@Fojtik
Copy link

Fojtik commented Apr 29, 2019

Why do you think that only APPLE handles 64 bit variables?

Proese use this fix:
void ftplib::sprint_rest(char *buf, off64_t offset) {
#if sizeof(offset)>4
sprintf(buf,"REST %lld",offset);
#else
sprintf(buf,"REST %ld",offset);
#endif
}

or if you are paranoid enougs and absolutelly sure that thare does not exist 32 bit code on APPLE:
void ftplib::sprint_rest(char *buf, off64_t offset) {
#if defined(APPLE) || sizeof(offset)>4
sprintf(buf,"REST %lld",offset);
#else
sprintf(buf,"REST %ld",offset);
#endif
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant