summaryrefslogtreecommitdiffhomepage
path: root/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index f7c75e0..9cf475e 100644
--- a/stream.c
+++ b/stream.c
@@ -225,7 +225,12 @@ int stream_write(lua_State * L)
while (free_space < (int) data_length)
{
- buffer_grow(L, &s->out);
+ const int res = buffer_grow(&s->out);
+ if (-1 == res)
+ {
+ lua_pushstring(L, strerror(errno));
+ return lua_error(L);
+ }
free_space = s->out.allocated - s->out.length;
}