diff options
Diffstat (limited to 'lem/io/stream.c')
-rw-r--r-- | lem/io/stream.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lem/io/stream.c b/lem/io/stream.c index cfbc1ed..efa2781 100644 --- a/lem/io/stream.c +++ b/lem/io/stream.c @@ -275,7 +275,7 @@ stream_write(lua_State *T) idx = 1; do { out = luaL_checklstring(T, ++idx, &out_len); - } while (out_len == 0 && idx <= top); + } while (out_len == 0 && idx < top); for (i = idx+1; i <= top; i++) (void)luaL_checkstring(T, i); @@ -284,7 +284,7 @@ stream_write(lua_State *T) return io_closed(T); if (s->w.data != NULL) return io_busy(T); - if (idx > top) { + if (out_len == 0) { lua_pushboolean(T, 1); return 1; } |