mirror of
https://github.com/curl/curl.git
synced 2024-11-21 01:16:58 +08:00
http_chunks.c: Fixed compilation warnings under some 32-bit systems
conversion from 'curl_off_t' to 'size_t', possible loss of data Where curl_off_t is a 64-bit word and size_t is 32-bit - for example with 32-bit Windows builds.
This commit is contained in:
parent
aba98991a5
commit
2cac75c4e4
@ -32,6 +32,7 @@
|
|||||||
#include "curl_memory.h"
|
#include "curl_memory.h"
|
||||||
#include "non-ascii.h" /* for Curl_convert_to_network prototype */
|
#include "non-ascii.h" /* for Curl_convert_to_network prototype */
|
||||||
#include "strtoofft.h"
|
#include "strtoofft.h"
|
||||||
|
#include "warnless.h"
|
||||||
|
|
||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
@ -188,7 +189,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
|
|||||||
/* We expect 'datasize' of data. We have 'length' right now, it can be
|
/* We expect 'datasize' of data. We have 'length' right now, it can be
|
||||||
more or less than 'datasize'. Get the smallest piece.
|
more or less than 'datasize'. Get the smallest piece.
|
||||||
*/
|
*/
|
||||||
piece = (ch->datasize >= length)?length:ch->datasize;
|
piece = curlx_sotouz((ch->datasize >= length)?length:ch->datasize);
|
||||||
|
|
||||||
/* Write the data portion available */
|
/* Write the data portion available */
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_LIBZ
|
||||||
@ -350,8 +351,8 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
|
|||||||
|
|
||||||
/* Record the length of any data left in the end of the buffer
|
/* Record the length of any data left in the end of the buffer
|
||||||
even if there's no more chunks to read */
|
even if there's no more chunks to read */
|
||||||
|
ch->dataleft = curlx_sotouz(length);
|
||||||
|
|
||||||
ch->dataleft = length;
|
|
||||||
return CHUNKE_STOP; /* return stop */
|
return CHUNKE_STOP; /* return stop */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user