diff options
| -rw-r--r-- | bugs | 5 | ||||
| -rw-r--r-- | lzio.c | 9 |
2 files changed, 10 insertions, 4 deletions
| @@ -70,3 +70,8 @@ lua_isnumber can modify it. | |||
| 70 | ** lstrlib.c | 70 | ** lstrlib.c |
| 71 | Thu Feb 4 17:08:50 EDT 1999 | 71 | Thu Feb 4 17:08:50 EDT 1999 |
| 72 | >> format "%s" may break limit of "sprintf" on some machines. | 72 | >> format "%s" may break limit of "sprintf" on some machines. |
| 73 | |||
| 74 | |||
| 75 | ** lzio.c | ||
| 76 | Thu Mar 4 11:49:37 EST 1999 | ||
| 77 | >> file stream cannot call fread after EOF. | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lzio.c,v 1.4 1998/12/28 13:44:54 roberto Exp roberto $ | 2 | ** $Id: lzio.c,v 1.5 1999/02/25 19:13:56 roberto Exp roberto $ |
| 3 | ** a generic input stream interface | 3 | ** a generic input stream interface |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -41,9 +41,10 @@ ZIO* zsopen (ZIO* z, char* s, char *name) | |||
| 41 | 41 | ||
| 42 | /* -------------------------------------------------------------- FILEs --- */ | 42 | /* -------------------------------------------------------------- FILEs --- */ |
| 43 | 43 | ||
| 44 | static int zffilbuf (ZIO* z) | 44 | static int zffilbuf (ZIO* z) { |
| 45 | { | 45 | int n; |
| 46 | int n=fread(z->buffer,1,ZBSIZE,z->u); | 46 | if (feof(z->u)) return EOZ; |
| 47 | n=fread(z->buffer,1,ZBSIZE,z->u); | ||
| 47 | if (n==0) return EOZ; | 48 | if (n==0) return EOZ; |
| 48 | z->n=n-1; | 49 | z->n=n-1; |
| 49 | z->p=z->buffer; | 50 | z->p=z->buffer; |
