commit d8edcc947b59de53c551373983750441a33bbe02 from: Omar Polo via: Thomas Adam date: Thu Jun 01 10:18:37 2023 UTC gotwebd: fix some got_error_from_errno2/3 calls it's not printf-like so %s don't make sense. Tweak the order of the arguments to obtain the intended output. commit - d6e785550aafeec2ec66d26c39b8453268c9d657 commit + d8edcc947b59de53c551373983750441a33bbe02 blob - c9ec594eafc00789a813deeb3f864bf32d7398c4 blob + 93e82002a185e0494f1787a149ae685c6e173e9f --- gotwebd/got_operations.c +++ gotwebd/got_operations.c @@ -1267,7 +1267,7 @@ got_init_repo_commit(struct repo_commit **rc) { *rc = calloc(1, sizeof(**rc)); if (*rc == NULL) - return got_error_from_errno2("%s: calloc", __func__); + return got_error_from_errno2(__func__, "calloc"); (*rc)->path = NULL; (*rc)->refs_str = NULL; @@ -1286,7 +1286,7 @@ got_init_repo_tag(struct repo_tag **rt) { *rt = calloc(1, sizeof(**rt)); if (*rt == NULL) - return got_error_from_errno2("%s: calloc", __func__); + return got_error_from_errno2(__func__, "calloc"); (*rt)->commit_id = NULL; (*rt)->tag_name = NULL; blob - cae5985aa3a3968aadb3cf089a8d0784b604f45d blob + d2716733267224b36363cf613d239bbbafff2239 --- gotwebd/gotweb.c +++ gotwebd/gotweb.c @@ -417,7 +417,7 @@ gotweb_init_transport(struct transport **t) *t = calloc(1, sizeof(**t)); if (*t == NULL) - return got_error_from_errno2("%s: calloc", __func__); + return got_error_from_errno2(__func__, "calloc"); TAILQ_INIT(&(*t)->repo_commits); TAILQ_INIT(&(*t)->repo_tags); @@ -435,13 +435,13 @@ gotweb_init_querystring(struct querystring **qs) *qs = calloc(1, sizeof(**qs)); if (*qs == NULL) - return got_error_from_errno2("%s: calloc", __func__); + return got_error_from_errno2(__func__, "calloc"); (*qs)->headref = strdup("HEAD"); if ((*qs)->headref == NULL) { free(*qs); *qs = NULL; - return got_error_from_errno2("%s: strdup", __func__); + return got_error_from_errno2(__func__, "strdup"); } (*qs)->action = INDEX; @@ -466,7 +466,7 @@ gotweb_parse_querystring(struct querystring **qs, char tok1 = strdup(qst); if (tok1 == NULL) - return got_error_from_errno2("%s: strdup", __func__); + return got_error_from_errno2(__func__, "strdup"); tok1_pair = tok1; tok1_end = tok1; @@ -477,7 +477,7 @@ gotweb_parse_querystring(struct querystring **qs, char tok2 = strdup(tok1_pair); if (tok2 == NULL) { free(tok1); - return got_error_from_errno2("%s: strdup", __func__); + return got_error_from_errno2(__func__, "strdup"); } tok2_pair = tok2; @@ -582,24 +582,24 @@ qa_found: case COMMIT: (*qs)->commit = strdup(value); if ((*qs)->commit == NULL) { - error = got_error_from_errno2("%s: strdup", - __func__); + error = got_error_from_errno2(__func__, + "strdup"); goto done; } break; case RFILE: (*qs)->file = strdup(value); if ((*qs)->file == NULL) { - error = got_error_from_errno2("%s: strdup", - __func__); + error = got_error_from_errno2(__func__, + "strdup"); goto done; } break; case FOLDER: (*qs)->folder = strdup(value); if ((*qs)->folder == NULL) { - error = got_error_from_errno2("%s: strdup", - __func__); + error = got_error_from_errno2(__func__, + "strdup"); goto done; } break; @@ -607,8 +607,8 @@ qa_found: free((*qs)->headref); (*qs)->headref = strdup(value); if ((*qs)->headref == NULL) { - error = got_error_from_errno2("%s: strdup", - __func__); + error = got_error_from_errno2(__func__, + "strdup"); goto done; } break; @@ -618,8 +618,8 @@ qa_found: (*qs)->index_page = strtonum(value, INT64_MIN, INT64_MAX, &errstr); if (errstr) { - error = got_error_from_errno3("%s: strtonum %s", - __func__, errstr); + error = got_error_from_errno3(__func__, + "strtonum", errstr); goto done; } if ((*qs)->index_page < 0) @@ -628,8 +628,8 @@ qa_found: case PATH: (*qs)->path = strdup(value); if ((*qs)->path == NULL) { - error = got_error_from_errno2("%s: strdup", - __func__); + error = got_error_from_errno2(__func__, + "strdup"); goto done; } break; @@ -639,8 +639,8 @@ qa_found: (*qs)->page = strtonum(value, INT64_MIN, INT64_MAX, &errstr); if (errstr) { - error = got_error_from_errno3("%s: strtonum %s", - __func__, errstr); + error = got_error_from_errno3(__func__, + "strtonum", errstr); goto done; } if ((*qs)->page < 0)