Remove a leftover abort and some fixes from cppcheck.

pull/1768/head
nicm 2019-05-30 20:54:03 +00:00
parent 8fb796b5b3
commit b26523c26d
5 changed files with 5 additions and 6 deletions

View File

@ -109,8 +109,7 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item)
format_defaults(ft, target_c, s, wl, wp);
if (args_has(args, 'a')) {
if (item != NULL)
format_each(ft, cmd_display_message_each, item);
format_each(ft, cmd_display_message_each, item);
return (CMD_RETURN_NORMAL);
}

View File

@ -2409,7 +2409,6 @@ input_osc_52(struct input_ctx *ictx, const char *p)
outlen = 4 * ((len + 2) / 3) + 1;
out = xmalloc(outlen);
if ((outlen = b64_ntop(buf, len, out, outlen)) == -1) {
abort();
free(out);
return;
}

View File

@ -480,7 +480,7 @@ mode_tree_add(struct mode_tree_data *mtd, struct mode_tree_item *parent,
saved = mode_tree_find_item(&mtd->saved, tag);
if (saved != NULL) {
if (parent == NULL || (parent != NULL && parent->expanded))
if (parent == NULL || parent->expanded)
mti->tagged = saved->tagged;
mti->expanded = saved->expanded;
} else if (expanded == -1)

View File

@ -365,7 +365,8 @@ options_array_set(struct options_entry *o, u_int idx, const char *value,
pr = cmd_parse_from_string(value, NULL);
switch (pr->status) {
case CMD_PARSE_EMPTY:
*cause = xstrdup("empty command");
if (cause != NULL)
*cause = xstrdup("empty command");
return (-1);
case CMD_PARSE_ERROR:
if (cause != NULL)

View File

@ -1136,7 +1136,7 @@ window_pane_reset_mode(struct window_pane *wp)
} else {
log_debug("%s: next mode is %s", __func__, next->mode->name);
wp->screen = next->screen;
if (next != NULL && next->mode->resize != NULL)
if (next->mode->resize != NULL)
next->mode->resize(next, wp->sx, wp->sy);
}
wp->flags |= (PANE_REDRAW|PANE_CHANGED);