]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Remove redundant check in gz_look().
authorMark Adler <fork@madler.net>
Thu, 6 Oct 2022 19:57:31 +0000 (12:57 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 17 Mar 2023 20:27:56 +0000 (21:27 +0100)
gzread.c

index c3b3a035fcca28374b037947cf32746259d543b4..f29371bd83a816abf71c8d0a32c882d8ca22e64d 100644 (file)
--- a/gzread.c
+++ b/gzread.c
@@ -145,11 +145,9 @@ static int gz_look(gz_state *state) {
        the output buffer is larger than the input buffer, which also assures
        space for gzungetc() */
     state->x.next = state->out;
-    if (strm->avail_in) {
-        memcpy(state->x.next, strm->next_in, strm->avail_in);
-        state->x.have = strm->avail_in;
-        strm->avail_in = 0;
-    }
+    memcpy(state->x.next, strm->next_in, strm->avail_in);
+    state->x.have = strm->avail_in;
+    strm->avail_in = 0;
     state->how = COPY;
     state->direct = 1;
     return 0;