aboutsummaryrefslogtreecommitdiff
path: root/lzio.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-03-20 13:00:56 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-03-20 13:00:56 -0300
commitb518d1407149a23d31b486f5bd3ef9e6daae93c1 (patch)
treec3dfc35a5aa3612e6657e065233d4b92f0a0fe64 /lzio.h
parent15dbb5346143a0af082fa96477db788a78fa6c61 (diff)
downloadlua-b518d1407149a23d31b486f5bd3ef9e6daae93c1.tar.gz
lua-b518d1407149a23d31b486f5bd3ef9e6daae93c1.tar.bz2
lua-b518d1407149a23d31b486f5bd3ef9e6daae93c1.zip
bug: zio mixes a 255 as first char in a buffer with EOZ
Diffstat (limited to 'lzio.h')
-rw-r--r--lzio.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/lzio.h b/lzio.h
index f2fbad90..2637eb1b 100644
--- a/lzio.h
+++ b/lzio.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lzio.h,v 1.13 2002/08/05 18:45:02 roberto Exp roberto $ 2** $Id: lzio.h,v 1.14 2002/10/08 18:46:08 roberto Exp roberto $
3** Buffered streams 3** Buffered streams
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -15,9 +15,10 @@
15 15
16typedef struct Zio ZIO; 16typedef struct Zio ZIO;
17 17
18#define zgetc(z) (((z)->n--)>0 ? \ 18
19 cast(int, cast(unsigned char, *(z)->p++)) : \ 19#define char2int(c) cast(int, cast(unsigned char, (c)))
20 luaZ_fill(z)) 20
21#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z))
21 22
22#define zname(z) ((z)->name) 23#define zname(z) ((z)->name)
23 24