Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@Fojtik

Description

@Fojtik

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions