Kill some dead stores and fix a null pointer deref, found by clang.

pull/1/head
Nicholas Marriott 2009-07-20 07:31:10 +00:00
parent ff2cc0e387
commit 73732ffa05
2 changed files with 6 additions and 6 deletions

View File

@ -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

@ -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. */