Try to merge across changes in zlib from 1.1.2 to 1.1.3.
[rsync/rsync.git] / zlib / infcodes.c
index 1d3baa9..d4e5ee9 100644 (file)
@@ -221,6 +221,13 @@ int r;
       c->mode = START;
       break;
     case WASH:          /* o: got eob, possibly more output */
+      if (k > 7)        /* return unused byte, if any */
+      {
+        Assert(k < 16, "inflate_codes grabbed too many bytes")
+        k -= 8;
+        n++;
+        p--;            /* can always return one */
+      }
       FLUSH
       if (s->read != s->write)
         LEAVE