diff options
author | 2009-07-20 07:31:10 +0000 | |
---|---|---|
committer | 2009-07-20 07:31:10 +0000 | |
commit | f475c9a8023e1649f1acc2955f6e5f14a07fdf12 (patch) | |
tree | 50abe8012f22ecd0255f97e4fa84e9f65e9ec170 /usr.bin/tmux/layout-set.c | |
parent | Move the offsets as well when swapping panes. (diff) | |
download | wireguard-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/layout-set.c')
-rw-r--r-- | usr.bin/tmux/layout-set.c | 12 |
1 files changed, 5 insertions, 7 deletions
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. */ |