summaryrefslogtreecommitdiff
path: root/infblock.c
diff options
context:
space:
mode:
Diffstat (limited to 'infblock.c')
-rw-r--r--infblock.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/infblock.c b/infblock.c
index 1fc0726..4c2ff65 100644
--- a/infblock.c
+++ b/infblock.c
@@ -1,5 +1,5 @@
/* infblock.c -- interpret and process block types to last block
- * Copyright (C) 1995 Mark Adler
+ * Copyright (C) 1995-1996 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -81,7 +81,7 @@ uLongf *c;
s->bitb = 0;
s->read = s->write = s->window;
if (s->checkfn != Z_NULL)
- s->check = (*s->checkfn)(0L, Z_NULL, 0);
+ z->adler = s->check = (*s->checkfn)(0L, Z_NULL, 0);
Trace((stderr, "inflate: blocks reset\n"));
}
@@ -172,17 +172,17 @@ int r;
case 3: /* illegal */
DUMPBITS(3)
s->mode = BAD;
- z->msg = "invalid block type";
+ z->msg = (char*)"invalid block type";
r = Z_DATA_ERROR;
LEAVE
}
break;
case LENS:
NEEDBITS(32)
- if (((~b) >> 16) != (b & 0xffff))
+ if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
{
s->mode = BAD;
- z->msg = "invalid stored block lengths";
+ z->msg = (char*)"invalid stored block lengths";
r = Z_DATA_ERROR;
LEAVE
}
@@ -215,7 +215,7 @@ int r;
if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
{
s->mode = BAD;
- z->msg = "too many length or distance symbols";
+ z->msg = (char*)"too many length or distance symbols";
r = Z_DATA_ERROR;
LEAVE
}
@@ -285,7 +285,7 @@ int r;
(c == 16 && i < 1))
{
s->mode = BAD;
- z->msg = "invalid bit length repeat";
+ z->msg = (char*)"invalid bit length repeat";
r = Z_DATA_ERROR;
LEAVE
}
@@ -383,3 +383,14 @@ uLongf *c;
Trace((stderr, "inflate: blocks freed\n"));
return Z_OK;
}
+
+
+void inflate_set_dictionary(s, z, d, n)
+inflate_blocks_statef *s;
+z_stream *z;
+const Bytef *d;
+uInt n;
+{
+ zmemcpy((charf *)s->window, d, n);
+ s->read = s->write = s->window + n;
+}