CURL_LLONG_MAX: avoid constant overflow

... when (CURL_SIZEOF_CURL_OFF_T == 4)
This commit is contained in:
Kamil Dudka 2010-05-29 12:26:17 +02:00
parent b1c1b9bb76
commit 35955179c6
2 changed files with 7 additions and 2 deletions

View File

@ -57,7 +57,12 @@
# define curlx_strtoofft strtol
#endif
#define CURL_LLONG_MAX CURL_OFF_T_C(0x7FFFFFFFFFFFFFFF)
#if (CURL_SIZEOF_CURL_OFF_T == 4)
# define CURL_LLONG_MAX CURL_OFF_T_C(0x7FFFFFFF)
#else
/* assume CURL_SIZEOF_CURL_OFF_T == 8 */
# define CURL_LLONG_MAX CURL_OFF_T_C(0x7FFFFFFFFFFFFFFF)
#endif
#define CURL_LLONG_MIN (-CURL_LLONG_MAX - CURL_OFF_T_C(1))
#endif /* HEADER_CURL_STRTOOFFT_H */

View File

@ -33,7 +33,7 @@ long chunk_bgn(const struct curl_fileinfo *finfo, void *ptr, int remains)
printf(" (parsed => %o)", finfo->perm);
printf("\n");
}
printf("Size: %lldB\n", (long long int)finfo->size);
printf("Size: %ldB\n", (long)finfo->size);
if(finfo->strings.user)
printf("User: %s\n", finfo->strings.user);
if(finfo->strings.group)