aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ping903.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ping903.c b/src/ping903.c
index 549f42e..5a0994f 100644
--- a/src/ping903.c
+++ b/src/ping903.c
@@ -839,7 +839,7 @@ try_auth(struct MHD_Connection *conn, const char *url, const char *method,
char *p;
char const *q;
- url_len = strcspn(url, "?");
+ url_len = strlen(url);
while (url_len > 1 && url[url_len-1] == '/')
--url_len;
url_buf = malloc(url_len + 1);
@@ -854,7 +854,7 @@ try_auth(struct MHD_Connection *conn, const char *url, const char *method,
p = url_buf;
q = url;
while (*q) {
- if (!(*q == '/' && q > url && q[-1] == '/'))
+ if (!(*q == '/' && (q[1] == 0 || (q > url && q[-1] == '/'))))
*p++ = *q;
q++;
}

Return to:

Send suggestions and report system problems to the System administrator.