bug: zio mixes a 255 as first char in a buffer with EOZ

This commit is contained in:
Roberto Ierusalimschy
2003-03-20 13:00:56 -03:00
parent 15dbb53461
commit b518d14071
3 changed files with 13 additions and 7 deletions

6
lzio.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lzio.c,v 1.22 2002/10/08 18:46:08 roberto Exp roberto $
** $Id: lzio.c,v 1.23 2002/12/04 17:38:31 roberto Exp roberto $
** a generic input stream interface
** See Copyright Notice in lua.h
*/
@@ -22,7 +22,7 @@ int luaZ_fill (ZIO *z) {
if (buff == NULL || size == 0) return EOZ;
z->n = size - 1;
z->p = buff;
return *(z->p++);
return char2int(*(z->p++));
}
@@ -33,7 +33,7 @@ int luaZ_lookahead (ZIO *z) {
z->n++;
z->p--;
}
return *z->p;
return char2int(*z->p);
}