diff options
Diffstat (limited to 'stream.c')
-rw-r--r-- | stream.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -134,19 +134,19 @@ int stream_read(lua_State * L) return stream_readk(L, LUA_OK, 2); // Intentionally do not remove arguments from the stack. } -static int grow(lua_State *, struct buffer *); +static void grow(lua_State *, struct buffer *); static int prepare_at_least(lua_State *, struct stream *, const int, lua_KContext); static int read_more(lua_State *, struct stream *, const int, lua_KContext); static int until(struct buffer *, const char *, const int); -static int grow(lua_State * L, struct buffer * b) +static void grow(lua_State * L, struct buffer * b) { int allocated = b->allocated + 1024; if (8192 < allocated) { lua_pushliteral(L, "Too large buffer"); - return lua_error(L); + lua_error(L); } void * buffer = realloc(b->data, allocated); @@ -154,13 +154,11 @@ static int grow(lua_State * L, struct buffer * b) if (NULL == buffer) { lua_pushliteral(L, "Could not grow buffer"); - return lua_error(L); + lua_error(L); } b->data = buffer; b->allocated = allocated; - - return 0; } static int read_more(lua_State * L, struct stream * s, int minimum_length, lua_KContext ctx) |