]> 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, 3 Feb 2023 14:49:02 +0000 (15:49 +0100)
gzread.c.in

index c421f9f56f86ad8efaac7956ba86a27a4566ee75..262517e4fec437ddc839dff09c5e4cffd34ebd72 100644 (file)
@@ -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;