diff options
author | Aki <please@ignore.pl> | 2021-03-05 00:51:41 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2021-03-05 00:51:41 +0100 |
commit | 13ea99aa41318e144c24bf8843de8100f05ece9c (patch) | |
tree | 3665c7a1486f8a26f929484fb033b6c6a7b16c79 | |
parent | 0c9cc5dd53a4f34c9ebc28c24f31a8c62e5ffe3a (diff) | |
download | plop-13ea99aa41318e144c24bf8843de8100f05ece9c.zip plop-13ea99aa41318e144c24bf8843de8100f05ece9c.tar.gz plop-13ea99aa41318e144c24bf8843de8100f05ece9c.tar.bz2 |
Removed return value from grow
-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) |