dvtm

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

commit 1fbfb22cb4e9d63954688a1c1aa1f64eb642ed5b
parent 140d93c547d6d4fcca26dd19ed2bc4fd3081e6c4
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu, 16 Oct 2014 22:47:14 +0200

Use C99 VLA instead of alloca

Maybe it would be best to just use malloc instead.

Diffstat:
vt.c | 7+------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/vt.c b/vt.c @@ -20,7 +20,6 @@ #include <errno.h> #include <fcntl.h> #include <langinfo.h> -#include <alloca.h> #include <limits.h> #include <signal.h> #include <stdio.h> @@ -38,9 +37,6 @@ #elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) # include <util.h> #endif -#if defined(__CYGWIN__) || defined(_AIX) || defined(__sun) -# include <alloca.h> -#endif #include "vt.h" @@ -246,8 +242,7 @@ static void row_roll(Row *start, Row *end, int count) count += n; if (count) { - Row *buf = alloca(count * sizeof(Row)); - + char buf[count * sizeof(Row)]; memcpy(buf, start, count * sizeof(Row)); memmove(start, start + count, (n - count) * sizeof(Row)); memcpy(end - count, buf, count * sizeof(Row));