1
0
mirror of https://github.com/tmux/tmux.git synced 2025-04-23 12:58:50 +00:00

Sync OpenBSD patchset 145:

Kill some dead stores and fix a null pointer deref, found by clang.
This commit is contained in:
Tiago Cunha 2009-07-20 15:51:32 +00:00
parent 16f424d25d
commit 62017452e9
2 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $Id: cmd-command-prompt.c,v 1.19 2009-07-17 09:26:21 nicm Exp $ */ /* $Id: cmd-command-prompt.c,v 1.20 2009-07-20 15:51:32 tcunha Exp $ */
/* /*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> * 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'; buf[len] = '\0';
s = buf; s = buf;
} }

View File

@ -1,4 +1,4 @@
/* $Id: layout-set.c,v 1.1 2009-07-20 15:42:05 tcunha Exp $ */ /* $Id: layout-set.c,v 1.2 2009-07-20 15:51:32 tcunha Exp $ */
/* /*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -122,10 +122,9 @@ layout_set_even_h(struct window *w)
return; return;
/* How many can we fit? */ /* How many can we fit? */
if (w->sx / n < PANE_MINIMUM + 1) { if (w->sx / n < PANE_MINIMUM + 1)
width = PANE_MINIMUM + 1; width = PANE_MINIMUM + 1;
n = UINT_MAX; else
} else
width = w->sx / n; width = w->sx / n;
/* Free the old root and construct a new. */ /* Free the old root and construct a new. */
@ -177,10 +176,9 @@ layout_set_even_v(struct window *w)
return; return;
/* How many can we fit? */ /* How many can we fit? */
if (w->sy / n < PANE_MINIMUM + 1) { if (w->sy / n < PANE_MINIMUM + 1)
height = PANE_MINIMUM + 1; height = PANE_MINIMUM + 1;
n = UINT_MAX; else
} else
height = w->sy / n; height = w->sy / n;
/* Free the old root and construct a new. */ /* Free the old root and construct a new. */