st.c: avoid VLA

This commit is contained in:
hazen2215 2023-06-17 15:45:06 +09:00
parent 089de203f6
commit 193a9f317d
1 changed files with 6 additions and 2 deletions

8
st.c
View File

@ -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]));
}