diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-05-30 20:54:04 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-05-30 20:54:04 +0000 |
commit | fe07de97ab0239344d83fc9793787b184ed8d02a (patch) | |
tree | 456f0180e9bba34402d6587dde5162f742eccd63 /usr.bin/tmux | |
parent | 20916ad05100534c2e495225e013048260ca520f (diff) |
Remove a leftover abort and some fixes from cppcheck.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/cmd-display-message.c | 5 | ||||
-rw-r--r-- | usr.bin/tmux/input.c | 3 | ||||
-rw-r--r-- | usr.bin/tmux/mode-tree.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/options.c | 5 | ||||
-rw-r--r-- | usr.bin/tmux/window.c | 4 |
5 files changed, 10 insertions, 11 deletions
diff --git a/usr.bin/tmux/cmd-display-message.c b/usr.bin/tmux/cmd-display-message.c index eb910c48a0a..e7b59eb9456 100644 --- a/usr.bin/tmux/cmd-display-message.c +++ b/usr.bin/tmux/cmd-display-message.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-display-message.c,v 1.49 2019/05/03 20:44:24 nicm Exp $ */ +/* $OpenBSD: cmd-display-message.c,v 1.50 2019/05/30 20:54:03 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -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); } diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c index 76d2f7063ad..4918b2c03b4 100644 --- a/usr.bin/tmux/input.c +++ b/usr.bin/tmux/input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input.c,v 1.154 2019/05/20 05:35:46 nicm Exp $ */ +/* $OpenBSD: input.c,v 1.155 2019/05/30 20:54:03 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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; } diff --git a/usr.bin/tmux/mode-tree.c b/usr.bin/tmux/mode-tree.c index 27c7fa8d578..67d6c6e580e 100644 --- a/usr.bin/tmux/mode-tree.c +++ b/usr.bin/tmux/mode-tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mode-tree.c,v 1.33 2019/05/28 07:18:42 nicm Exp $ */ +/* $OpenBSD: mode-tree.c,v 1.34 2019/05/30 20:54:03 nicm Exp $ */ /* * Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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) diff --git a/usr.bin/tmux/options.c b/usr.bin/tmux/options.c index c0a4b3ba2d3..b1031470045 100644 --- a/usr.bin/tmux/options.c +++ b/usr.bin/tmux/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.46 2019/05/23 14:03:44 nicm Exp $ */ +/* $OpenBSD: options.c,v 1.47 2019/05/30 20:54:03 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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) diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index f388e74f3d0..bb00d1c0a90 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.229 2019/05/07 10:25:15 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.230 2019/05/30 20:54:03 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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); |