summaryrefslogtreecommitdiff
path: root/lib/libz/infcodes.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-03-12 00:26:31 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-03-12 00:26:31 +0000
commit09d05ff04856fed02e2cfa9a8a8b72e1074a59b4 (patch)
tree4e0612ba554b903b35e1a3ec5b9e97c8b1c04fe2 /lib/libz/infcodes.c
parent1e1ccbf8f1be5a063a5e89a8019bbc6bb12c5fb1 (diff)
Update to zlib-1.1.4
Diffstat (limited to 'lib/libz/infcodes.c')
-rw-r--r--lib/libz/infcodes.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/libz/infcodes.c b/lib/libz/infcodes.c
index d4e5ee9a554..9ff7008fca6 100644
--- a/lib/libz/infcodes.c
+++ b/lib/libz/infcodes.c
@@ -1,5 +1,6 @@
+/* $OpenBSD: infcodes.c,v 1.3 2002/03/12 00:25:57 millert Exp $ */
/* infcodes.c -- process literals and length/distance pairs
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -196,15 +197,9 @@ int r;
Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist));
c->mode = COPY;
case COPY: /* o: copying bytes in window, waiting for space */
-#ifndef __TURBOC__ /* Turbo C bug for following expression */
- f = (uInt)(q - s->window) < c->sub.copy.dist ?
- s->end - (c->sub.copy.dist - (q - s->window)) :
- q - c->sub.copy.dist;
-#else
f = q - c->sub.copy.dist;
- if ((uInt)(q - s->window) < c->sub.copy.dist)
- f = s->end - (c->sub.copy.dist - (uInt)(q - s->window));
-#endif
+ while (f < s->window) /* modulo window size-"while" instead */
+ f += s->end - s->window; /* of "if" handles invalid distances */
while (c->len)
{
NEEDOUT