summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-11-28 12:07:12 +0000
committerubq323 <ubq323@ubq323.website>2024-11-28 12:07:12 +0000
commit506598af568b79151c0030849ae0762c5add9273 (patch)
tree7ac4e100e6b84ce718509ca084c8af9a3e359a75
parenta4cde11f6b1e9bab24567a9a4fbefd707dbaa977 (diff)
reduce initial buffer size
-rw-r--r--run.c3
1 files changed, 2 insertions, 1 deletions
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;
}