/* deflate.c -- compress data using the deflation algorithm
- Copyright (C) 1999, 2006, 2009-2011 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2006, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 1992-1993 Jean-loup Gailly
This program is free software; you can redistribute it and/or modify
compr_level = pack_level;
/* Initialize the hash table. */
-#if defined(MAXSEG_64K) && HASH_BITS == 15
+#if defined MAXSEG_64K && HASH_BITS == 15
for (j = 0; j < HASH_SIZE; j++) head[j] = NIL;
#else
memzero((char*)head, HASH_SIZE*sizeof(*head));
/* Skip to next match if the match length cannot increase
* or if the match length is less than 2:
*/
-#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
+#if defined UNALIGNED_OK && MAX_MATCH == 258
/* This code assumes sizeof(unsigned short) == 2. Do not use
* UNALIGNED_OK if your compiler uses a different size.
*/
n = read_buf((char*)window+strstart+lookahead, more);
if (n == 0 || n == (unsigned)EOF) {
eofile = 1;
+ /* Don't let garbage pollute the dictionary. */
+ memzero (window + strstart + lookahead, MIN_MATCH - 1);
} else {
lookahead += n;
}