use luaL_buffinitsize

This commit is contained in:
Cloud Wu
2020-08-11 14:08:25 +08:00
parent 3025e4765a
commit d3d5e3063a

View File

@@ -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) {