dvtm

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

commit acd3d25af9a24aaa1f11791ff94149abea0c0af2
parent c16ea5c1b8869a78a2ea8337df4a9a2b7f45d206
Author: Marc Andre Tanner <mat@brain-dump.org>
Date:   Sun,  8 Jul 2012 16:54:21 +0200

Properly NUL terminate window titles

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>

Diffstat:
dvtm.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dvtm.c b/dvtm.c @@ -703,8 +703,10 @@ create(const char *args[]) { c->window = newwin(wah, waw, way, wax); c->term = vt_create(screen.h - 1, screen.w, screen.history); c->cmd = cmd; - if (args && args[1]) - strncpy(c->title, args[1], sizeof(c->title)); + if (args && args[1]) { + strncpy(c->title, args[1], sizeof(c->title) - 1); + c->title[sizeof(c->title) - 1] = '\0'; + } c->pid = vt_forkpty(c->term, "/bin/sh", pargs, env, &c->pty); vt_set_data(c->term, c); vt_set_event_handler(c->term, term_event_handler);