summaryrefslogtreecommitdiff
path: root/lib/strtoofft.h
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2010-05-29 12:26:17 +0200
committerKamil Dudka <kdudka@redhat.com>2010-05-29 21:23:18 +0200
commit35955179c6c3935e9b876090e29bb90c5740838f (patch)
tree820bd6a1a1916f85dabf31960a90d76830560a65 /lib/strtoofft.h
parentb1c1b9bb76e01900de6ffd7e173eec3d2c65a310 (diff)
downloadcurl-35955179c6c3935e9b876090e29bb90c5740838f.tar.gz
CURL_LLONG_MAX: avoid constant overflow
... when (CURL_SIZEOF_CURL_OFF_T == 4)
Diffstat (limited to 'lib/strtoofft.h')
-rw-r--r--lib/strtoofft.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/strtoofft.h b/lib/strtoofft.h
index bf27a173c..c791bc96e 100644
--- a/lib/strtoofft.h
+++ b/lib/strtoofft.h
@@ -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 */