From f475c9a8023e1649f1acc2955f6e5f14a07fdf12 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 20 Jul 2009 07:31:10 +0000 Subject: Kill some dead stores and fix a null pointer deref, found by clang. --- usr.bin/tmux/layout-set.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'usr.bin/tmux/layout-set.c') 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 @@ -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. */ -- cgit v1.2.3-59-g8ed1b