summaryrefslogtreecommitdiffstats
path: root/lib/libz/infcodes.c
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2002-03-11 22:36:26 +0000
committergreen <green@FreeBSD.org>2002-03-11 22:36:26 +0000
commit7ca574f59c0cfa1c18dfad38e2695df7c5356ccd (patch)
treebff2461c1653758bf9b8443f106c8627f9369418 /lib/libz/infcodes.c
parent08dc078a21e50f8bfdb56683ae019a8081cf84b5 (diff)
downloadFreeBSD-src-7ca574f59c0cfa1c18dfad38e2695df7c5356ccd.zip
FreeBSD-src-7ca574f59c0cfa1c18dfad38e2695df7c5356ccd.tar.gz
Fix conflicts.
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 7711cf8..7c5073b 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
*/
@@ -199,15 +199,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
OpenPOWER on IntegriCloud