diff options
Diffstat (limited to 'infutil.c')
-rw-r--r-- | infutil.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -40,7 +40,8 @@ int r; | |||
40 | z->total_out += n; | 40 | z->total_out += n; |
41 | 41 | ||
42 | /* update check information */ | 42 | /* update check information */ |
43 | s->check = adler32(s->check, q, n); | 43 | if (s->checkfn != Z_NULL) |
44 | s->check = (*s->checkfn)(s->check, q, n); | ||
44 | 45 | ||
45 | /* copy as far as end of window */ | 46 | /* copy as far as end of window */ |
46 | while (n--) *p++ = *q++; | 47 | while (n--) *p++ = *q++; |
@@ -48,8 +49,10 @@ int r; | |||
48 | /* see if more to copy at beginning of window */ | 49 | /* see if more to copy at beginning of window */ |
49 | if (q == s->end) | 50 | if (q == s->end) |
50 | { | 51 | { |
51 | /* wrap source pointer */ | 52 | /* wrap pointers */ |
52 | q = s->window; | 53 | q = s->window; |
54 | if (s->write == s->end) | ||
55 | s->write = s->window; | ||
53 | 56 | ||
54 | /* compute bytes to copy */ | 57 | /* compute bytes to copy */ |
55 | n = s->write - q; | 58 | n = s->write - q; |
@@ -61,7 +64,8 @@ int r; | |||
61 | z->total_out += n; | 64 | z->total_out += n; |
62 | 65 | ||
63 | /* update check information */ | 66 | /* update check information */ |
64 | s->check = adler32(s->check, q, n); | 67 | if (s->checkfn != Z_NULL) |
68 | s->check = (*s->checkfn)(s->check, q, n); | ||
65 | 69 | ||
66 | /* copy */ | 70 | /* copy */ |
67 | while (n--) *p++ = *q++; | 71 | while (n--) *p++ = *q++; |