This commit is contained in:
Nikita Ivanov 2022-06-05 00:19:11 +05:00
parent 98770e2842
commit 302c77245b
No known key found for this signature in database
GPG Key ID: 6E656AC5B97B5133

View File

@ -115,8 +115,6 @@ static void check_init_previews(void)
} }
} }
#define CMD_ERR_BUF 256
static int run(Preview *p, int *exitcode) static int run(Preview *p, int *exitcode)
{ {
int pipe_fds[2]; int pipe_fds[2];
@ -132,9 +130,9 @@ static int run(Preview *p, int *exitcode)
close(pipe_fds[1]); close(pipe_fds[1]);
if (*exitcode != FAILED_PREVIEW_EC) { if (*exitcode != FAILED_PREVIEW_EC) {
char buf[CMD_ERR_BUF]; char buf[256];
int len; int len;
while ((len = read(pipe_fds[0], buf, CMD_ERR_BUF)) > 0) { while ((len = read(pipe_fds[0], buf, LEN(buf))) > 0) {
write(STDOUT_FILENO, buf, len); write(STDOUT_FILENO, buf, len);
} }