aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/buffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index ac5c531..7148be3 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -103,11 +103,14 @@ int buffer_meth_send(lua_State *L, p_buffer buf) {
103* object:receive() interface 103* object:receive() interface
104\*-------------------------------------------------------------------------*/ 104\*-------------------------------------------------------------------------*/
105int buffer_meth_receive(lua_State *L, p_buffer buf) { 105int buffer_meth_receive(lua_State *L, p_buffer buf) {
106 int err = IO_DONE, top = lua_gettop(L); 106 int err = IO_DONE, top;
107 luaL_Buffer b; 107 luaL_Buffer b;
108 size_t size; 108 size_t size;
109 const char *part = luaL_optlstring(L, 3, "", &size); 109 const char *part = luaL_optlstring(L, 3, "", &size);
110 timeout_markstart(buf->tm); 110 timeout_markstart(buf->tm);
111 /* make sure we don't confuse buffer stuff with arguments */
112 lua_settop(L, 3);
113 top = lua_gettop(L);
111 /* initialize buffer with optional extra prefix 114 /* initialize buffer with optional extra prefix
112 * (useful for concatenating previous partial results) */ 115 * (useful for concatenating previous partial results) */
113 luaL_buffinit(L, &b); 116 luaL_buffinit(L, &b);