commit 8afc6416647585ec2695d57eee7c226216e4111c
Author: Laslo Hunhold <[email protected]>
AuthorDate: Sun Jan 24 21:35:11 2021 +0100
Commit: Laslo Hunhold <[email protected]>
CommitDate: Sun Jan 24 21:35:11 2021 +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]>
diff --git a/http.c b/http.c
index 96dd540..f1e63a4 100644
--- a/http.c
+++ b/http.c
@@ -760,11 +760,12 @@ http_prepare_response(const struct request *req, struct
response *res,
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",
tmpuri)) {
+ s = S_REQUEST_TOO_LARGE;
+ goto err;
+ }
}
}