aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2008-06-22 06:57:00 +0000
committerDan Fandrich <dan@coneharvesters.com>2008-06-22 06:57:00 +0000
commit90a6a59a2f27124917ee6931f66594a636a4c591 (patch)
treeb4c26d2a7fa1a96d3a2125b61490617c48bdfc56
parent8bae3d9007ffdaf21d01cef23a6c6afd342cd55c (diff)
Stopped using ranges in scanf character sequences (e.g. %[a-z]) since that
is not ANSI C, just a common extension. This caused problems on at least Open Watcom C.
-rw-r--r--CHANGES5
-rw-r--r--lib/parsedate.c4
-rw-r--r--lib/url.c2
3 files changed, 7 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index be600cbc7..61b9fbc6f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,11 @@
Changelog
+Daniel Fandrich (21 Jun 2008)
+- Stopped using ranges in scanf character sequences (e.g. %[a-z]) since that
+ is not ANSI C, just a common extension. This caused problems on
+ at least Open Watcom C.
+
Yang Tse (20 Jun 2008)
- Modified configuration script to actually verify if the compiler is good
enough at detecting compilation errors or at least it has been properly
diff --git a/lib/parsedate.c b/lib/parsedate.c
index 78cc96fe2..d1d8d5837 100644
--- a/lib/parsedate.c
+++ b/lib/parsedate.c
@@ -84,8 +84,6 @@
#include <curl/curl.h>
-static time_t parsedate(const char *date);
-
const char * const Curl_wkday[] =
{"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"};
static const char * const weekday[] =
@@ -248,7 +246,7 @@ static time_t parsedate(const char *date)
/* a name coming up */
char buf[32]="";
size_t len;
- sscanf(date, "%31[A-Za-z]", buf);
+ sscanf(date, "%31[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]", buf);
len = strlen(buf);
if(wdaynum == -1) {
diff --git a/lib/url.c b/lib/url.c
index 6391edb28..e61ec298c 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3839,7 +3839,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
* The conn->host.name is currently [user:passwd@]host[:port] where host
* could be a hostname, IPv4 address or IPv6 address.
*************************************************************/
- if((1 == sscanf(conn->host.name, "[%*39[0-9a-fA-F:.]%c", &endbracket)) &&
+ if((1 == sscanf(conn->host.name, "[%*39[0123456789abcdefABCDEF:.]%c", &endbracket)) &&
(']' == endbracket)) {
/* this is a RFC2732-style specified IP-address */
conn->bits.ipv6_ip = TRUE;