Put docindex-appending into an else-clause - quark - quark web server | |
git clone git://git.suckless.org/quark | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 8afc6416647585ec2695d57eee7c226216e4111c | |
parent deeec27c56d8f5049abac0dad3782f5daf95a1a3 | |
Author: Laslo Hunhold <[email protected]> | |
Date: Sun, 24 Jan 2021 21:35:11 +0100 | |
Put docindex-appending into an else-clause | |
The previous if-branch leaves (goto, return) in all cases, making | |
no functional difference, but this improves the explicitness. | |
Signed-off-by: Laslo Hunhold <[email protected]> | |
Diffstat: | |
M http.c | 11 ++++++----- | |
1 file changed, 6 insertions(+), 5 deletions(-) | |
--- | |
diff --git a/http.c b/http.c | |
@@ -760,11 +760,12 @@ http_prepare_response(const struct request *req, struct r… | |
S_FORBIDDEN : S_NOT_FOUND; | |
goto err; | |
} | |
- } | |
- /* copy the found index back to the final path */ | |
- if (esnprintf(res->path, sizeof(res->path), "%s", tmpuri)) { | |
- s = S_REQUEST_TOO_LARGE; | |
- goto err; | |
+ } else { | |
+ /* docindex is valid, write tmpuri to response-path */ | |
+ if (esnprintf(res->path, sizeof(res->path), "%s", tmpu… | |
+ s = S_REQUEST_TOO_LARGE; | |
+ goto err; | |
+ } | |
} | |
} | |