aboutsummaryrefslogtreecommitdiff
path: root/lzio.c
diff options
context:
space:
mode:
Diffstat (limited to 'lzio.c')
-rw-r--r--lzio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lzio.c b/lzio.c
index 48269ca7..7a05dba4 100644
--- a/lzio.c
+++ b/lzio.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lzio.c,v 1.9 1999/11/09 17:59:35 roberto Exp roberto $ 2** $Id: lzio.c,v 1.10 2000/02/08 16:39:42 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*/
@@ -24,7 +24,7 @@ static int zmfilbuf (ZIO* z) {
24ZIO* zmopen (ZIO* z, const char* b, int size, const char *name) { 24ZIO* zmopen (ZIO* z, const char* b, int size, const char *name) {
25 if (b==NULL) return NULL; 25 if (b==NULL) return NULL;
26 z->n = size; 26 z->n = size;
27 z->p = (unsigned const char *)b; 27 z->p = (const unsigned char *)b;
28 z->filbuf = zmfilbuf; 28 z->filbuf = zmfilbuf;
29 z->u = NULL; 29 z->u = NULL;
30 z->name = name; 30 z->name = name;
@@ -69,7 +69,7 @@ int zread (ZIO *z, void *b, int n) {
69 if (z->n == 0) { 69 if (z->n == 0) {
70 if (z->filbuf(z) == EOZ) 70 if (z->filbuf(z) == EOZ)
71 return n; /* return number of missing bytes */ 71 return n; /* return number of missing bytes */
72 zungetc(z); /* put result from 'filbuf' in the buffer */ 72 zungetc(z); /* put result from `filbuf' in the buffer */
73 } 73 }
74 m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ 74 m = (n <= z->n) ? n : z->n; /* min. between n and z->n */
75 memcpy(b, z->p, m); 75 memcpy(b, z->p, m);