dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 22fbe253443877714db6e682abf6e21f98928fd3
parent e89ea23eafd06e58732c59b477e9df1dfd606a38
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Fri, 31 Oct 2014 11:24:44 +0100

vt_create: cosmetic fixes

Diffstat:
vt.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vt.c b/vt.c @@ -1416,23 +1416,23 @@ void vt_default_colors_set(Vt *t, attr_t attrs, short fg, short bg) Vt *vt_create(int rows, int cols, int scroll_size) { - Vt *t; - if (rows <= 0 || cols <= 0) return NULL; - t = calloc(1, sizeof(Vt)); + Vt *t = calloc(1, sizeof(Vt)); if (!t) return NULL; t->pty = -1; t->deffg = t->defbg = -1; + t->buffer = &t->buffer_normal; + if (!buffer_init(&t->buffer_normal, rows, cols, scroll_size) || !buffer_init(&t->buffer_alternate, rows, cols, 0)) { free(t); return NULL; } - t->buffer = &t->buffer_normal; + return t; }