aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libz/infcodes.c
diff options
context:
space:
mode:
authorBrian Feldman <green@FreeBSD.org>2002-03-11 22:30:00 +0000
committerBrian Feldman <green@FreeBSD.org>2002-03-11 22:30:00 +0000
commitcdbc2952f3c7d8c5993b21348ba22c7fc21a0d7e (patch)
tree84fe7aeb75da641a2646fdfe7fa54e523fe8fa50 /lib/libz/infcodes.c
parent419364778002757352c413e7891e35b3f8fa9001 (diff)
downloadsrc-cdbc2952f3c7d8c5993b21348ba22c7fc21a0d7e.tar.gz
src-cdbc2952f3c7d8c5993b21348ba22c7fc21a0d7e.zip
Import zlib 1.1.4 onto the vendor branch.
Notes
Notes: svn path=/vendor/libz/dist/; revision=92111
Diffstat (limited to 'lib/libz/infcodes.c')
-rw-r--r--lib/libz/infcodes.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/libz/infcodes.c b/lib/libz/infcodes.c
index d4e5ee9a5543..9abe5412b9c8 100644
--- a/lib/libz/infcodes.c
+++ b/lib/libz/infcodes.c
@@ -1,5 +1,5 @@
/* 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 +196,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