Commit d1a6f3279503f0a70b9e7f7ff02a33827d59d795

Fix warnings emitted with -pedantic

Commit diff

tig.c

 
956956static enum request
957957add_run_request(enum keymap keymap, int key, int argc, char **argv)
958958{
959 struct run_request *tmp;
960 struct run_request req = { keymap, key };
959 struct run_request *req;
960 char cmd[SIZEOF_STR];
961961 size_t bufpos;
962962
963963 for (bufpos = 0; argc > 0; argc--, argv++)
964 if (!string_format_from(req.cmd, &bufpos, "%s ", *argv))
964 if (!string_format_from(cmd, &bufpos, "%s ", *argv))
965965 return REQ_NONE;
966966
967 req.cmd[bufpos - 1] = 0;
968
969 tmp = realloc(run_request, (run_requests + 1) * sizeof(*run_request));
970 if (!tmp)
967 req = realloc(run_request, (run_requests + 1) * sizeof(*run_request));
968 if (!req)
971969 return REQ_NONE;
972970
973 run_request = tmp;
974 run_request[run_requests++] = req;
971 run_request = req;
972 req = &run_request[run_requests++];
973 string_copy(req->cmd, cmd);
974 req->keymap = keymap;
975 req->key = key;
975976
976977 return REQ_NONE + run_requests;
977978}
14661466
14671467
14681468enum line_graphic {
1469 LINE_GRAPHIC_VLINE,
1469 LINE_GRAPHIC_VLINE
14701470};
14711471
14721472static int line_graphics[] = {
24232423 OPEN_SPLIT = 1, /* Split current view. */
24242424 OPEN_BACKGROUNDED = 2, /* Backgrounded. */
24252425 OPEN_RELOAD = 4, /* Reload view even if it is the current. */
2426 OPEN_NOMAXIMIZE = 8, /* Do not maximize the current view. */
2426 OPEN_NOMAXIMIZE = 8 /* Do not maximize the current view. */
24272427};
24282428
24292429static void
40754075 return FALSE;
40764076 }
40774077 } else {
4078 char buf[] = { status->status, ' ', ' ', ' ', 0 };
4078 static char buf[] = { '?', ' ', ' ', ' ', 0 };
40794079
4080 buf[0] = status->status;
40804081 if (draw_text(view, line->type, buf, TRUE))
40814082 return TRUE;
40824083 type = LINE_DEFAULT;
toggle raw diff