From 193a9f317dd530b2a25d22ff8ee401770b54b31d Mon Sep 17 00:00:00 2001 From: hazen2215 Date: Sat, 17 Jun 2023 15:45:06 +0900 Subject: [PATCH] st.c: avoid VLA --- st.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/st.c b/st.c index a5e5407..65e821f 100644 --- a/st.c +++ b/st.c @@ -823,7 +823,9 @@ externalpipe(const Arg *arg) { int fd[2]; int y, m; - char str[(term.col + 1) * UTF_SIZ]; + /* char str[(term.col + 1) * UTF_SIZ]; */ + char *str; + str = malloc((term.col + 1) * UTF_SIZ * sizeof(char)); void (*psigpipe)(int); const ExternalPipe *ep = arg->v; @@ -2481,7 +2483,9 @@ tdumpsel(void) void tdumpline(int n) { - char str[(term.col + 1) * UTF_SIZ]; + /* char str[(term.col + 1) * UTF_SIZ]; */ + char *str; + str = malloc((term.col + 1) * UTF_SIZ * sizeof(char)); tprinter(str, tgetline(str, &term.line[n][0])); }