mirror of https://github.com/lua/lua
file stream cannot call fread after EOF.
This commit is contained in:
parent
ab8ea5c38a
commit
6233d21c9d
5
bugs
5
bugs
|
@ -70,3 +70,8 @@ lua_isnumber can modify it.
|
|||
** lstrlib.c
|
||||
Thu Feb 4 17:08:50 EDT 1999
|
||||
>> format "%s" may break limit of "sprintf" on some machines.
|
||||
|
||||
|
||||
** lzio.c
|
||||
Thu Mar 4 11:49:37 EST 1999
|
||||
>> file stream cannot call fread after EOF.
|
||||
|
|
9
lzio.c
9
lzio.c
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: lzio.c,v 1.4 1998/12/28 13:44:54 roberto Exp roberto $
|
||||
** $Id: lzio.c,v 1.5 1999/02/25 19:13:56 roberto Exp roberto $
|
||||
** a generic input stream interface
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
@ -41,9 +41,10 @@ ZIO* zsopen (ZIO* z, char* s, char *name)
|
|||
|
||||
/* -------------------------------------------------------------- FILEs --- */
|
||||
|
||||
static int zffilbuf (ZIO* z)
|
||||
{
|
||||
int n=fread(z->buffer,1,ZBSIZE,z->u);
|
||||
static int zffilbuf (ZIO* z) {
|
||||
int n;
|
||||
if (feof(z->u)) return EOZ;
|
||||
n=fread(z->buffer,1,ZBSIZE,z->u);
|
||||
if (n==0) return EOZ;
|
||||
z->n=n-1;
|
||||
z->p=z->buffer;
|
||||
|
|
Loading…
Reference in New Issue