diff options
author | ubq323 <ubq323@ubq323.website> | 2024-11-28 12:07:12 +0000 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-11-28 12:07:12 +0000 |
commit | 506598af568b79151c0030849ae0762c5add9273 (patch) | |
tree | 7ac4e100e6b84ce718509ca084c8af9a3e359a75 | |
parent | a4cde11f6b1e9bab24567a9a4fbefd707dbaa977 (diff) |
reduce initial buffer size
-rw-r--r-- | run.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; } |