if((-1 != data->set.infilesize) &&
(data->set.infilesize != *ftp->bytecountp) &&
!data->set.crlf) {
- failf(data, "Uploaded unaligned file size (" FORMAT_OFF_T " out of " FORMAT_OFF_T " bytes)",
+ failf(data, "Uploaded unaligned file size (%" FORMAT_OFF_T
+ " out of %" FORMAT_OFF_T " bytes)",
*ftp->bytecountp, data->set.infilesize);
conn->bits.close = TRUE; /* close this connection since we don't
know what state this error leaves us in */
else {
if((-1 != conn->size) && (conn->size != *ftp->bytecountp) &&
(conn->maxdownload != *ftp->bytecountp)) {
- failf(data, "Received only partial file: " FORMAT_OFF_T " bytes",
+ failf(data, "Received only partial file: %" FORMAT_OFF_T " bytes",
*ftp->bytecountp);
conn->bits.close = TRUE; /* close this connection since we don't
know what state this error leaves us in */
passed += actuallyread;
if(actuallyread != readthisamountnow) {
- failf(data, "Could only read " FORMAT_OFF_T " bytes from the input",
- passed);
+ failf(data, "Could only read %" FORMAT_OFF_T
+ " bytes from the input", passed);
return CURLE_FTP_COULDNT_USE_REST;
}
}
if((-1 == to) && (from>=0)) {
/* X - */
conn->resume_from = from;
- infof(data, "FTP RANGE " FORMAT_OFF_T " to end of file\n", from);
+ infof(data, "FTP RANGE %" FORMAT_OFF_T " to end of file\n", from);
}
else if(from < 0) {
/* -Y */
totalsize = -from;
conn->maxdownload = -from;
conn->resume_from = from;
- infof(data, "FTP RANGE the last " FORMAT_OFF_T " bytes\n", totalsize);
+ infof(data, "FTP RANGE the last %" FORMAT_OFF_T " bytes\n", totalsize);
}
else {
/* X-Y */
totalsize = to-from;
conn->maxdownload = totalsize+1; /* include the last mentioned byte */
conn->resume_from = from;
- infof(data, "FTP RANGE from " FORMAT_OFF_T " getting " FORMAT_OFF_T " bytes\n", from,
- conn->maxdownload);
+ infof(data, "FTP RANGE from %" FORMAT_OFF_T
+ " getting %" FORMAT_OFF_T " bytes\n", from, conn->maxdownload);
}
- infof(data, "range-download from " FORMAT_OFF_T " to " FORMAT_OFF_T ", totally " FORMAT_OFF_T " bytes\n",
+ infof(data, "range-download from %" FORMAT_OFF_T
+ " to %" FORMAT_OFF_T ", totally %" FORMAT_OFF_T " bytes\n",
from, to, conn->maxdownload);
ftp->dont_check = TRUE; /* dont check for successful transfer */
}
if(conn->resume_from< 0) {
/* We're supposed to download the last abs(from) bytes */
if(foundsize < -conn->resume_from) {
- failf(data, "Offset (" FORMAT_OFF_T ") was beyond file size (" FORMAT_OFF_T ")",
+ failf(data, "Offset (%" FORMAT_OFF_T
+ ") was beyond file size (%" FORMAT_OFF_T ")",
conn->resume_from, foundsize);
return CURLE_FTP_BAD_DOWNLOAD_RESUME;
}
}
else {
if(foundsize < conn->resume_from) {
- failf(data, "Offset (" FORMAT_OFF_T ") was beyond file size (" FORMAT_OFF_T ")",
+ failf(data, "Offset (%" FORMAT_OFF_T
+ ") was beyond file size (%" FORMAT_OFF_T ")",
conn->resume_from, foundsize);
return CURLE_FTP_BAD_DOWNLOAD_RESUME;
}
}
/* Set resume file transfer offset */
- infof(data, "Instructs server to resume from offset " FORMAT_OFF_T "\n",
+ infof(data, "Instructs server to resume from offset %" FORMAT_OFF_T
+ "\n",
conn->resume_from);
- FTPSENDF(conn, "REST " FORMAT_OFF_T "", conn->resume_from);
+ FTPSENDF(conn, "REST %" FORMAT_OFF_T, conn->resume_from);
result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
if(result)
if(size > conn->maxdownload && conn->maxdownload > 0)
size = conn->size = conn->maxdownload;
- infof(data, "Getting file with size: " FORMAT_OFF_T "\n", size);
+ infof(data, "Getting file with size: %" FORMAT_OFF_T "\n", size);
/* FTP download: */
result=Curl_Transfer(conn, SECONDARYSOCKET, size, FALSE,
result = ftp_getsize(conn, ftp->file, &filesize);
if(CURLE_OK == result) {
- sprintf(buf, "Content-Length: " FORMAT_OFF_T "\r\n", filesize);
+ sprintf(buf, "Content-Length: %" FORMAT_OFF_T "\r\n", filesize);
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
if(result)
return result;
passed += actuallyread;
if(actuallyread != readthisamountnow) {
- failf(data, "Could only read " FORMAT_OFF_T
+ failf(data, "Could only read %" FORMAT_OFF_T
" bytes from the input",
passed);
return CURLE_READ_ERROR;
curl_off_t total_expected_size=
conn->resume_from + data->set.infilesize;
conn->allocptr.rangeline =
- aprintf("Content-Range: bytes %s" FORMAT_OFF_T "/"
- FORMAT_OFF_T "\r\n",
+ aprintf("Content-Range: bytes %s%" FORMAT_OFF_T
+ "/%" FORMAT_OFF_T "\r\n",
conn->range, total_expected_size-1,
total_expected_size);
}
/* Range was selected and then we just pass the incoming range and
append total size */
conn->allocptr.rangeline =
- aprintf("Content-Range: bytes %s/" FORMAT_OFF_T "\r\n",
+ aprintf("Content-Range: bytes %s/%" FORMAT_OFF_T "\r\n",
conn->range, data->set.infilesize);
}
}
if((data->set.infilesize>0) && !conn->bits.upload_chunky)
/* only add Content-Length if not uploading chunked */
add_bufferf(req_buffer,
- "Content-Length: " FORMAT_OFF_T "\r\n", /* size */
+ "Content-Length: %" FORMAT_OFF_T "\r\n", /* size */
data->set.infilesize );
add_bufferf(req_buffer, "\r\n");
#define ONE_GIGABYTE (1024*1024*1024)
if(bytes < 100000) {
- sprintf(max5, "%5Od", (curl_off_t)bytes);
+ sprintf(max5, "%5" FORMAT_OFF_T, (curl_off_t)bytes);
return max5;
}
if(bytes < (10000*ONE_KILOBYTE)) {
- sprintf(max5, "%4Odk", (curl_off_t)bytes/ONE_KILOBYTE);
+ sprintf(max5, "%4" FORMAT_OFF_T "k", (curl_off_t)bytes/ONE_KILOBYTE);
return max5;
}
if(bytes < (100*ONE_MEGABYTE)) {
}
#if SIZEOF_CURL_OFF_T > 4
if((curl_off_t)bytes < ((curl_off_t)10000*ONE_MEGABYTE)) {
- sprintf(max5, "%4OdM", (curl_off_t)bytes/ONE_MEGABYTE);
+ sprintf(max5, "%4" FORMAT_OFF_T "M", (curl_off_t)bytes/ONE_MEGABYTE);
return max5;
}
/* 10000 MB - 8589934587 GB !! */
sprintf(max5, "%4.1fG", bytes/ONE_GIGABYTE);
#else
- sprintf(max5, "%4OdM", (curl_off_t)bytes/ONE_MEGABYTE);
+ sprintf(max5, "%4" FORMAT_OFF_T "M", (curl_off_t)bytes/ONE_MEGABYTE);
#endif
return max5;
if (!data->progress.callback) {
if(conn->resume_from)
fprintf(data->set.err,
- "** Resuming transfer from byte position " FORMAT_OFF_T
+ "** Resuming transfer from byte position %" FORMAT_OFF_T
"\n",
conn->resume_from);
fprintf(data->set.err,