diff options
Diffstat (limited to '')
-rw-r--r-- | src/buffer.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/buffer.c b/src/buffer.c index fff1634..7148be3 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
@@ -2,10 +2,7 @@ | |||
2 | * Input/Output interface for Lua programs | 2 | * Input/Output interface for Lua programs |
3 | * LuaSocket toolkit | 3 | * LuaSocket toolkit |
4 | \*=========================================================================*/ | 4 | \*=========================================================================*/ |
5 | #include "lua.h" | 5 | #include "luasocket.h" |
6 | #include "lauxlib.h" | ||
7 | #include "compat.h" | ||
8 | |||
9 | #include "buffer.h" | 6 | #include "buffer.h" |
10 | 7 | ||
11 | /*=========================================================================*\ | 8 | /*=========================================================================*\ |
@@ -106,11 +103,14 @@ int buffer_meth_send(lua_State *L, p_buffer buf) { | |||
106 | * object:receive() interface | 103 | * object:receive() interface |
107 | \*-------------------------------------------------------------------------*/ | 104 | \*-------------------------------------------------------------------------*/ |
108 | int buffer_meth_receive(lua_State *L, p_buffer buf) { | 105 | int buffer_meth_receive(lua_State *L, p_buffer buf) { |
109 | int err = IO_DONE, top = lua_gettop(L); | 106 | int err = IO_DONE, top; |
110 | luaL_Buffer b; | 107 | luaL_Buffer b; |
111 | size_t size; | 108 | size_t size; |
112 | const char *part = luaL_optlstring(L, 3, "", &size); | 109 | const char *part = luaL_optlstring(L, 3, "", &size); |
113 | 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); | ||
114 | /* initialize buffer with optional extra prefix | 114 | /* initialize buffer with optional extra prefix |
115 | * (useful for concatenating previous partial results) */ | 115 | * (useful for concatenating previous partial results) */ |
116 | luaL_buffinit(L, &b); | 116 | luaL_buffinit(L, &b); |