From: nicm Date: Sun, 5 Aug 2018 08:59:30 +0000 (+0000) Subject: calloc the mode data instead of malloc and initialize everything. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=cd04ef62831cef188ab431d4333660da1fde01bf;p=openbsd calloc the mode data instead of malloc and initialize everything. --- 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 @@ -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 @@ -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) {