fix compiler warning: conversion may lose significant bits
This commit is contained in:
14
lib/ftp.c
14
lib/ftp.c
@@ -1366,18 +1366,16 @@ static CURLcode ftp_state_ul_setup(struct connectdata *conn,
|
||||
else {
|
||||
curl_off_t passed=0;
|
||||
do {
|
||||
curl_off_t readthisamountnow = (data->state.resume_from - passed);
|
||||
curl_off_t actuallyread;
|
||||
size_t readthisamountnow =
|
||||
(data->state.resume_from - passed > CURL_OFF_T_C(BUFSIZE)) ?
|
||||
BUFSIZE : curlx_sotouz(data->state.resume_from - passed);
|
||||
|
||||
if(readthisamountnow > BUFSIZE)
|
||||
readthisamountnow = BUFSIZE;
|
||||
|
||||
actuallyread = (curl_off_t)
|
||||
conn->fread_func(data->state.buffer, 1, (size_t)readthisamountnow,
|
||||
size_t actuallyread =
|
||||
conn->fread_func(data->state.buffer, 1, readthisamountnow,
|
||||
conn->fread_in);
|
||||
|
||||
passed += actuallyread;
|
||||
if((actuallyread <= 0) || (actuallyread > readthisamountnow)) {
|
||||
if((actuallyread == 0) || (actuallyread > readthisamountnow)) {
|
||||
/* this checks for greater-than only to make sure that the
|
||||
CURL_READFUNC_ABORT return code still aborts */
|
||||
failf(data, "Failed to read data");
|
||||
|
||||
Reference in New Issue
Block a user