aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-06-30 13:07:05 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-06-30 13:07:05 +0000
commiteb60ba23f57eb51aba371c42a5af1e331514a28f (patch)
treefe6d98d0e3c1acf4978e2f013b73e6f404169608 /lib
parent69aac49f79999214d2423140258728f8b70e0047 (diff)
- Stephen Collyer and Tor Arntsen helped identify a flaw in the range code
which output the range using a signed variable where it should rather use unsigned.
Diffstat (limited to 'lib')
-rw-r--r--lib/setup.h8
-rw-r--r--lib/url.c2
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/setup.h b/lib/setup.h
index 38ae32099..1f8505d13 100644
--- a/lib/setup.h
+++ b/lib/setup.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -139,16 +139,18 @@
#ifndef SIZEOF_CURL_OFF_T
/* If we don't know the size here, we assume a conservative size: 4. When
- building libcurl, the actual size of this variable should be define in the
+ building libcurl, the actual size of this variable should be defined in the
config*.h file. */
#define SIZEOF_CURL_OFF_T 4
#endif
-/* We set up our internal prefered (CURL_)FORMAT_OFF_T here */
+/* We set up our internal prefered (CURL_)FORMAT_OFF_T[U] here */
#if SIZEOF_CURL_OFF_T > 4
#define FORMAT_OFF_T "lld"
+#define FORMAT_OFF_TU "llu" /* the unsigned version */
#else
#define FORMAT_OFF_T "ld"
+#define FORMAT_OFF_TU "lu" /* thus unsigned version */
#endif /* SIZEOF_CURL_OFF_T */
#ifndef _REENTRANT
diff --git a/lib/url.c b/lib/url.c
index e61ec298c..f1f0c3cd7 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3118,7 +3118,7 @@ static CURLcode setup_range(struct SessionHandle *data)
free(s->range);
if(s->resume_from)
- s->range = aprintf("%" FORMAT_OFF_T "-", s->resume_from);
+ s->range = aprintf("%" FORMAT_OFF_TU "-", s->resume_from);
else
s->range = strdup(data->set.str[STRING_SET_RANGE]);