Commit 8f214b627d8d732248d5ae12b5c1de0c3ba3c6a7

Stefan Sperling 2020-02-17T20:34:27

don't use got_error_from_errno() in situations where errno was not set

diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 879b0a9..866c545 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -1702,8 +1702,7 @@ gw_parse_querystring(struct gw_trans *gw_trans)
 	unsigned int i;
 
 	if (gw_trans->gw_req->fieldnmap[0]) {
-		error = got_error_from_errno("bad parse");
-		return error;
+		return got_error(GOT_ERR_QUERYSTRING);
 	} else if ((p = gw_trans->gw_req->fieldmap[KEY_PATH])) {
 		/* define gw_trans->repo_path */
 		gw_trans->repo_name = p->parsed.s;
@@ -1727,7 +1726,9 @@ gw_parse_querystring(struct gw_trans *gw_trans)
 		}
 		if (gw_trans->action == -1) {
 			gw_trans->action = GW_ERR;
-			gw_trans->error = got_error_from_errno("bad action");
+			gw_trans->error = got_error_msg(GOT_ERR_QUERYSTRING,
+			    p != NULL ? "bad action in querystring" :
+			    "no action in querystring");
 			return error;
 		}