diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2018-08-05 08:59:31 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2018-08-05 08:59:31 +0000 |
commit | 10ebabaf65cc4e667c6db8d7299e0d5b67cdda00 (patch) | |
tree | 0b4f0f11a9733fc5dc29fe575ccacfc7da9b01a5 /usr.bin | |
parent | 88b4e50b3e3993c7dea2536ed9d71ba76932dcb4 (diff) |
calloc the mode data instead of malloc and initialize everything.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/window-copy.c | 16 | ||||
-rw-r--r-- | usr.bin/tmux/window.c | 3 |
2 files changed, 3 insertions, 16 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index b68b99cbe49..13331ce1709 100644 --- a/usr.bin/tmux/window-copy.c +++ b/usr.bin/tmux/window-copy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-copy.c,v 1.193 2018/08/01 15:22:40 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.194 2018/08/05 08:59:30 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -201,22 +201,10 @@ window_copy_init(struct window_pane *wp, __unused struct cmd_find_state *fs, struct window_copy_mode_data *data; struct screen *s; - wp->modedata = data = xmalloc(sizeof *data); - - data->oy = 0; - data->cx = 0; - data->cy = 0; + wp->modedata = data = xcalloc(1, sizeof *data); data->cursordrag = CURSORDRAG_NONE; - - data->lastcx = 0; - data->lastsx = 0; - - data->backing_written = 0; - data->lineflag = LINE_SEL_NONE; - data->rectflag = 0; - data->scroll_exit = 0; if (wp->searchstr != NULL) { data->searchtype = WINDOW_COPY_SEARCHUP; diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index d931af5819a..f94724fdbf1 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.211 2018/08/02 18:35:21 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.212 2018/08/05 08:59:30 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -894,7 +894,6 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv, char *argv0, *cmd, **argvp; const char *ptr, *first, *home; struct termios tio2; - int i; sigset_t set, oldset; if (wp->fd != -1) { |