summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/fetch.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libfetch/fetch.c')
-rw-r--r--lib/libfetch/fetch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c
index 303861a..963557b 100644
--- a/lib/libfetch/fetch.c
+++ b/lib/libfetch/fetch.c
@@ -307,7 +307,7 @@ fetchParseURL(const char *URL)
/* scheme name */
if ((p = strstr(URL, ":/"))) {
- snprintf(u->scheme, URL_SCHEMELEN+1, "%.*s", p - URL, URL);
+ snprintf(u->scheme, URL_SCHEMELEN+1, "%.*s", (int)(p - URL), URL);
URL = ++p;
/*
* Only one slash: no host, leave slash as part of document
@@ -318,7 +318,8 @@ fetchParseURL(const char *URL)
} else {
p = URL;
}
- if (!*URL || *URL == '/' || *URL == '.' || strchr(URL, '/') == NULL)
+ if (!*URL || *URL == '/' || *URL == '.' ||
+ (u->scheme[0] == '\0' && strchr(URL, '/') == NULL))
goto nohost;
p = strpbrk(URL, "/@");
OpenPOWER on IntegriCloud