mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
calloc the mode data instead of malloc and initialize everything.
This commit is contained in:
@ -201,22 +201,10 @@ window_copy_init(struct window_pane *wp, __unused struct cmd_find_state *fs,
|
|||||||
struct window_copy_mode_data *data;
|
struct window_copy_mode_data *data;
|
||||||
struct screen *s;
|
struct screen *s;
|
||||||
|
|
||||||
wp->modedata = data = xmalloc(sizeof *data);
|
wp->modedata = data = xcalloc(1, sizeof *data);
|
||||||
|
|
||||||
data->oy = 0;
|
|
||||||
data->cx = 0;
|
|
||||||
data->cy = 0;
|
|
||||||
|
|
||||||
data->cursordrag = CURSORDRAG_NONE;
|
data->cursordrag = CURSORDRAG_NONE;
|
||||||
|
|
||||||
data->lastcx = 0;
|
|
||||||
data->lastsx = 0;
|
|
||||||
|
|
||||||
data->backing_written = 0;
|
|
||||||
|
|
||||||
data->lineflag = LINE_SEL_NONE;
|
data->lineflag = LINE_SEL_NONE;
|
||||||
data->rectflag = 0;
|
|
||||||
data->scroll_exit = 0;
|
|
||||||
|
|
||||||
if (wp->searchstr != NULL) {
|
if (wp->searchstr != NULL) {
|
||||||
data->searchtype = WINDOW_COPY_SEARCHUP;
|
data->searchtype = WINDOW_COPY_SEARCHUP;
|
||||||
|
1
window.c
1
window.c
@ -894,7 +894,6 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
|
|||||||
char *argv0, *cmd, **argvp;
|
char *argv0, *cmd, **argvp;
|
||||||
const char *ptr, *first, *home;
|
const char *ptr, *first, *home;
|
||||||
struct termios tio2;
|
struct termios tio2;
|
||||||
int i;
|
|
||||||
sigset_t set, oldset;
|
sigset_t set, oldset;
|
||||||
|
|
||||||
if (wp->fd != -1) {
|
if (wp->fd != -1) {
|
||||||
|
Reference in New Issue
Block a user