This commit is contained in:
Roberto Ierusalimschy 2003-11-18 08:44:53 -02:00
parent ab7d9bfd0c
commit 53c7f86194
1 changed files with 2 additions and 3 deletions

5
lzio.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lzio.c,v 1.26 2003/08/25 20:00:50 roberto Exp roberto $ ** $Id: lzio.c,v 1.27 2003/08/27 20:57:52 roberto Exp roberto $
** a generic input stream interface ** a generic input stream interface
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -77,8 +77,7 @@ size_t luaZ_read (ZIO *z, void *b, size_t n) {
char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) { char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) {
if (n > buff->buffsize) { if (n > buff->buffsize) {
if (n < LUA_MINBUFFER) n = LUA_MINBUFFER; if (n < LUA_MINBUFFER) n = LUA_MINBUFFER;
luaM_reallocvector(L, buff->buffer, buff->buffsize, n, char); luaZ_resizebuffer(L, buff, n);
buff->buffsize = n;
} }
return buff->buffer; return buff->buffer;
} }