Skip to content

Commit ed16107

Browse files
committed
Revert previous commit, restoring the memcpy() call.
The reported issue was due to an error in their test code, not in inflate. This use of memcpy() in inflate is correct.
1 parent ab0266a commit ed16107

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

inflate.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -884,12 +884,12 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
884884
if (copy > have) copy = have;
885885
if (copy > left) copy = left;
886886
if (copy == 0) goto inf_leave;
887+
zmemcpy(put, next, copy);
887888
have -= copy;
889+
next += copy;
888890
left -= copy;
891+
put += copy;
889892
state->length -= copy;
890-
do {
891-
*put++ = *next++;
892-
} while (--copy);
893893
break;
894894
}
895895
Tracev((stderr, "inflate: stored end\n"));

0 commit comments

Comments
 (0)