initialize all missed kcgi_err enums. pointed out by kurt@
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index de469c2..0708437 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -556,7 +556,7 @@ gw_index(struct gw_trans *gw_trans)
char *href_briefs = NULL, *href_commits = NULL, *href_tree = NULL;
char *href_tags = NULL;
unsigned int prev_disp = 0, next_disp = 1, dir_c = 0;
- enum kcgi_err kerr;
+ enum kcgi_err kerr = KCGI_OK;
if (pledge("stdio rpath proc exec sendfd unveil",
NULL) == -1) {
@@ -1587,7 +1587,7 @@ gw_tree(struct gw_trans *gw_trans)
struct gw_header *header = NULL;
char *tree = NULL, *tree_html = NULL, *tree_html_disp = NULL;
char *age = NULL;
- enum kcgi_err kerr;
+ enum kcgi_err kerr = KCGI_OK;
if (pledge("stdio rpath proc exec sendfd unveil", NULL) == -1)
return got_error_from_errno("pledge");
@@ -1777,7 +1777,7 @@ gw_tag(struct gw_trans *gw_trans)
{
const struct got_error *error = NULL;
struct gw_header *header = NULL;
- enum kcgi_err kerr;
+ enum kcgi_err kerr = KCGI_OK;
if (pledge("stdio rpath proc exec sendfd unveil", NULL) == -1)
return got_error_from_errno("pledge");
@@ -2091,7 +2091,7 @@ gw_init_gw_dir(struct gw_dir **gw_dir, const char *dir)
static const struct got_error *
gw_display_open(struct gw_trans *gw_trans, enum khttp code, enum kmime mime)
{
- enum kcgi_err kerr;
+ enum kcgi_err kerr = KCGI_OK;
kerr = khttp_head(gw_trans->gw_req, kresps[KRESP_ALLOW], "GET");
if (kerr != KCGI_OK)
@@ -2132,7 +2132,7 @@ static const struct got_error *
gw_display_index(struct gw_trans *gw_trans)
{
const struct got_error *error;
- enum kcgi_err kerr;
+ enum kcgi_err kerr = KCGI_OK;
/* catch early querystring errors */
if (gw_trans->error)
@@ -2161,7 +2161,7 @@ gw_display_index(struct gw_trans *gw_trans)
static const struct got_error *
gw_error(struct gw_trans *gw_trans)
{
- enum kcgi_err kerr;
+ enum kcgi_err kerr = KCGI_OK;
kerr = khtml_puts(gw_trans->gw_html_req, gw_trans->error->msg);
@@ -2172,7 +2172,7 @@ static int
gw_template(size_t key, void *arg)
{
const struct got_error *error = NULL;
- enum kcgi_err kerr;
+ enum kcgi_err kerr = KCGI_OK;
struct gw_trans *gw_trans = arg;
char *img_src = NULL;
@@ -2489,7 +2489,7 @@ static const struct got_error *
gw_gen_author_header(struct gw_trans *gw_trans, const char *str)
{
const struct got_error *error = NULL;
- enum kcgi_err kerr;
+ enum kcgi_err kerr = KCGI_OK;
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV,
KATTR_ID, "header_author_title", KATTR__MAX);
@@ -2519,7 +2519,7 @@ static const struct got_error *
gw_gen_committer_header(struct gw_trans *gw_trans, const char *str)
{
const struct got_error *error = NULL;
- enum kcgi_err kerr;
+ enum kcgi_err kerr = KCGI_OK;
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV,
KATTR_ID, "header_committer_title", KATTR__MAX);
@@ -2549,7 +2549,7 @@ static const struct got_error *
gw_gen_commit_msg_header(struct gw_trans *gw_trans, char *str)
{
const struct got_error *error = NULL;
- enum kcgi_err kerr;
+ enum kcgi_err kerr = KCGI_OK;
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV,
KATTR_ID, "header_commit_msg_title", KATTR__MAX);
@@ -2579,7 +2579,7 @@ static const struct got_error *
gw_gen_tree_header(struct gw_trans *gw_trans, char *str)
{
const struct got_error *error = NULL;
- enum kcgi_err kerr;
+ enum kcgi_err kerr = KCGI_OK;
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV,
KATTR_ID, "header_tree_title", KATTR__MAX);
@@ -4625,7 +4625,7 @@ main(int argc, char *argv[])
struct gw_dir *dir = NULL, *tdir;
const char *page = "index";
int gw_malloc = 1;
- enum kcgi_err kerr;
+ enum kcgi_err kerr = KCGI_OK;
if ((gw_trans = malloc(sizeof(struct gw_trans))) == NULL)
errx(1, "malloc");