summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-03-05 00:51:41 +0100
committerAki <please@ignore.pl>2021-03-05 00:51:41 +0100
commit13ea99aa41318e144c24bf8843de8100f05ece9c (patch)
tree3665c7a1486f8a26f929484fb033b6c6a7b16c79
parent0c9cc5dd53a4f34c9ebc28c24f31a8c62e5ffe3a (diff)
downloadplop-13ea99aa41318e144c24bf8843de8100f05ece9c.zip
plop-13ea99aa41318e144c24bf8843de8100f05ece9c.tar.gz
plop-13ea99aa41318e144c24bf8843de8100f05ece9c.tar.bz2
Removed return value from grow
-rw-r--r--stream.c10
1 files 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)