aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main.c b/main.c
index 7e917fc..7914d25 100644
--- a/main.c
+++ b/main.c
@@ -819,8 +819,7 @@ static int createdir(const struct http_payload *const p,
return page_bad_request(r);
}
- char *name = NULL;
- const char *dir = NULL;
+ char *name = NULL, *dir = NULL;
for (size_t i = 0; i < n; i++)
{
@@ -855,10 +854,13 @@ static int createdir(const struct http_payload *const p,
/* HTML input forms use '+' for whitespace, rather than %20. */
{
- char *c = name;
+ char *c = name, *d = dir;
while ((c = strchr(c, '+')))
*c = ' ';
+
+ while ((d = strchr(d, '+')))
+ *d = ' ';
}
const char *const root = auth_dir(a);