dist = s->strstart - hash_head;
if (dist > 0 && (dist-1) < (s->w_size - 1)) {
- match_len = compare258(s->window + s->strstart, s->window + s->strstart - dist);
+ match_len = compare258(s->window + s->strstart, s->window + hash_head);
if (match_len >= MIN_MATCH) {
if (match_len > s->lookahead)
if (match_len > MAX_MATCH)
match_len = MAX_MATCH;
- static_emit_ptr(s, match_len - MIN_MATCH, s->strstart - hash_head);
+ static_emit_ptr(s, match_len - MIN_MATCH, dist);
s->lookahead -= match_len;
s->strstart += match_len;
continue;