summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-07-20 07:31:10 +0000
committernicm <nicm@openbsd.org>2009-07-20 07:31:10 +0000
commitf475c9a8023e1649f1acc2955f6e5f14a07fdf12 (patch)
tree50abe8012f22ecd0255f97e4fa84e9f65e9ec170 /usr.bin/tmux
parentMove the offsets as well when swapping panes. (diff)
downloadwireguard-openbsd-f475c9a8023e1649f1acc2955f6e5f14a07fdf12.tar.xz
wireguard-openbsd-f475c9a8023e1649f1acc2955f6e5f14a07fdf12.zip
Kill some dead stores and fix a null pointer deref, found by clang.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/cmd-command-prompt.c4
-rw-r--r--usr.bin/tmux/layout-set.c12
2 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/tmux/cmd-command-prompt.c b/usr.bin/tmux/cmd-command-prompt.c
index f0e6e9d5948..be532a75738 100644
--- a/usr.bin/tmux/cmd-command-prompt.c
+++ b/usr.bin/tmux/cmd-command-prompt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-command-prompt.c,v 1.4 2009/07/17 06:13:27 nicm Exp $ */
+/* $OpenBSD: cmd-command-prompt.c,v 1.5 2009/07/20 07:31:10 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -140,6 +140,8 @@ cmd_command_prompt_callback(void *data, const char *s)
}
}
+ if (buf == NULL)
+ return (0);
buf[len] = '\0';
s = buf;
}
diff --git a/usr.bin/tmux/layout-set.c b/usr.bin/tmux/layout-set.c
index 7bdaa8b2851..3cd54630dd2 100644
--- a/usr.bin/tmux/layout-set.c
+++ b/usr.bin/tmux/layout-set.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: layout-set.c,v 1.1 2009/07/19 13:21:40 nicm Exp $ */
+/* $OpenBSD: layout-set.c,v 1.2 2009/07/20 07:31:10 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -122,10 +122,9 @@ layout_set_even_h(struct window *w)
return;
/* How many can we fit? */
- if (w->sx / n < PANE_MINIMUM + 1) {
+ if (w->sx / n < PANE_MINIMUM + 1)
width = PANE_MINIMUM + 1;
- n = UINT_MAX;
- } else
+ else
width = w->sx / n;
/* Free the old root and construct a new. */
@@ -177,10 +176,9 @@ layout_set_even_v(struct window *w)
return;
/* How many can we fit? */
- if (w->sy / n < PANE_MINIMUM + 1) {
+ if (w->sy / n < PANE_MINIMUM + 1)
height = PANE_MINIMUM + 1;
- n = UINT_MAX;
- } else
+ else
height = w->sy / n;
/* Free the old root and construct a new. */