mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
strtoofft: rename CURL_LLONG_MIN -> CURL_OFF_T_MIN
... and CURL_LLONG_MAX -> CURL_OFF_T_MAX
This commit is contained in:
parent
35955179c6
commit
20ae9d4f71
@ -590,8 +590,8 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr)
|
||||
curl_off_t fsize;
|
||||
finfo->b_data[parser->item_offset + parser->item_length - 1] = 0;
|
||||
fsize = curlx_strtoofft(finfo->b_data+parser->item_offset, &p, 10);
|
||||
if(p[0] == '\0' && fsize != CURL_LLONG_MAX &&
|
||||
fsize != CURL_LLONG_MIN) {
|
||||
if(p[0] == '\0' && fsize != CURL_OFF_T_MAX &&
|
||||
fsize != CURL_OFF_T_MIN) {
|
||||
parser->file_data->flags |= CURLFINFOFLAG_KNOWN_SIZE;
|
||||
parser->file_data->size = fsize;
|
||||
}
|
||||
@ -918,8 +918,8 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr)
|
||||
finfo->size = curlx_strtoofft(finfo->b_data + parser->item_offset,
|
||||
&endptr, 10);
|
||||
if(!*endptr) {
|
||||
if(finfo->size == CURL_LLONG_MAX ||
|
||||
finfo->size == CURL_LLONG_MIN) {
|
||||
if(finfo->size == CURL_OFF_T_MAX ||
|
||||
finfo->size == CURL_OFF_T_MIN) {
|
||||
if(errno == ERANGE) {
|
||||
PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST);
|
||||
return bufflen;
|
||||
|
@ -131,9 +131,9 @@ curlx_strtoll(const char *nptr, char **endptr, int base)
|
||||
}
|
||||
else {
|
||||
if(is_negative)
|
||||
value = CURL_LLONG_MIN;
|
||||
value = CURL_OFF_T_MIN;
|
||||
else
|
||||
value = CURL_LLONG_MAX;
|
||||
value = CURL_OFF_T_MAX;
|
||||
|
||||
SET_ERRNO(ERANGE);
|
||||
}
|
||||
|
@ -58,11 +58,11 @@
|
||||
#endif
|
||||
|
||||
#if (CURL_SIZEOF_CURL_OFF_T == 4)
|
||||
# define CURL_LLONG_MAX CURL_OFF_T_C(0x7FFFFFFF)
|
||||
# define CURL_OFF_T_MAX CURL_OFF_T_C(0x7FFFFFFF)
|
||||
#else
|
||||
/* assume CURL_SIZEOF_CURL_OFF_T == 8 */
|
||||
# define CURL_LLONG_MAX CURL_OFF_T_C(0x7FFFFFFFFFFFFFFF)
|
||||
# define CURL_OFF_T_MAX CURL_OFF_T_C(0x7FFFFFFFFFFFFFFF)
|
||||
#endif
|
||||
#define CURL_LLONG_MIN (-CURL_LLONG_MAX - CURL_OFF_T_C(1))
|
||||
#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - CURL_OFF_T_C(1))
|
||||
|
||||
#endif /* HEADER_CURL_STRTOOFFT_H */
|
||||
|
@ -1613,7 +1613,7 @@ static int str2offset(curl_off_t *val, const char *str)
|
||||
{
|
||||
#if (CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG)
|
||||
*val = curlx_strtoofft(str, NULL, 0);
|
||||
if((*val == CURL_LLONG_MAX || *val == CURL_LLONG_MIN) && (ERRNO == ERANGE))
|
||||
if((*val == CURL_OFF_T_MAX || *val == CURL_OFF_T_MIN) && (ERRNO == ERANGE))
|
||||
return 1;
|
||||
#else
|
||||
*val = strtol(str, NULL, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user