From 506598af568b79151c0030849ae0762c5add9273 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 28 Nov 2024 12:07:12 +0000 Subject: reduce initial buffer size --- run.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run.c b/run.c index ac25d23..85e2793 100644 --- a/run.c +++ b/run.c @@ -85,7 +85,7 @@ char *run(int count, char **progs[], size_t inputlen, char *inputstr, size_t *ou // if the program produces too much data, you will be killed size_t readed = 0; - size_t cap = 1024*1024; + size_t cap = 2048; char *buf = CKN(malloc(cap*sizeof(char))); size_t remaining = cap; size_t amt = 0; @@ -172,6 +172,7 @@ finish: free(argvs); } free(outbuf); + if (fail) return lua_error(L); return 1; } -- cgit v1.2.3