diff --git a/src/api/process.c b/src/api/process.c index 95d5ff63..ea43b52e 100644 --- a/src/api/process.c +++ b/src/api/process.c @@ -10,8 +10,6 @@ #include #include "api.h" -#define READ_BUF_SIZE 4096 - #define L_GETTABLE(L, idx, key, conv, def) ( \ lua_getfield(L, idx, key), \ conv(L, -1, def) \ @@ -230,7 +228,7 @@ static int f_returncode(lua_State *L) static int g_read(lua_State* L, int stream) { process_t* self = (process_t*) lua_touserdata(L, 1); - unsigned long read_size = luaL_optunsigned(L, 2, READ_BUF_SIZE); + unsigned long read_size = luaL_checkunsigned(L, 2); luaL_Buffer b; uint8_t* buffer = (uint8_t*) luaL_buffinitsize(L, &b, read_size);