calloc the mode data instead of malloc and initialize everything.

pull/1434/head
nicm 2018-08-05 08:59:30 +00:00
parent d6ff630498
commit f5d7a80272
2 changed files with 1 additions and 14 deletions

View File

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

View File

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