From d3d5e3063aca741d90ec471aa3e96868e1a8dace Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Tue, 11 Aug 2020 14:08:25 +0800 Subject: [PATCH] use luaL_buffinitsize --- lualib-src/lua-socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lualib-src/lua-socket.c b/lualib-src/lua-socket.c index fec74260..ed9a226b 100644 --- a/lualib-src/lua-socket.c +++ b/lualib-src/lua-socket.c @@ -184,7 +184,7 @@ pop_lstring(lua_State *L, struct socket_buffer *sb, int sz, int skip) { } luaL_Buffer b; - luaL_buffinit(L, &b); + luaL_buffinitsize(L, &b, sz); for (;;) { int bytes = current->sz - sb->offset; if (bytes >= sz) {