From 6a853fcb8b9e333d768c739c36c99b144bbde607 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 25 Feb 1999 18:07:26 -0300 Subject: details (from lhf) --- lzio.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lzio.c') diff --git a/lzio.c b/lzio.c index 8e11ef4d..04fba442 100644 --- a/lzio.c +++ b/lzio.c @@ -1,5 +1,5 @@ /* -** $Id: lzio.c,v 1.3 1997/12/22 20:57:18 roberto Exp roberto $ +** $Id: lzio.c,v 1.4 1998/12/28 13:44:54 roberto Exp roberto $ ** a generic input stream interface ** See Copyright Notice in lua.h */ @@ -64,16 +64,15 @@ ZIO* zFopen (ZIO* z, FILE* f, char *name) /* --------------------------------------------------------------- read --- */ -int zread (ZIO *z, void *b, int n) -{ +int zread (ZIO *z, void *b, int n) { while (n) { int m; if (z->n == 0) { if (z->filbuf(z) == EOZ) - return n; /* retorna quantos faltaram ler */ - zungetc(z); /* poe o resultado de filbuf no buffer */ + return n; /* return number of missing bytes */ + zungetc(z); /* put result from 'filbuf' in the buffer */ } - m = (n <= z->n) ? n : z->n; /* minimo de n e z->n */ + m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ memcpy(b, z->p, m); z->n -= m; z->p += m; -- cgit v1.2.3-55-g6feb