From 13ea99aa41318e144c24bf8843de8100f05ece9c Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 5 Mar 2021 00:51:41 +0100 Subject: Removed return value from grow --- stream.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/stream.c b/stream.c index 1033b23..f0c6723 100644 --- a/stream.c +++ b/stream.c @@ -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) -- cgit v1.1