From: Simon Tatham Date: Tue, 14 Feb 2017 22:13:24 +0000 (+0000) Subject: lz77_compress: change scope of variable 'hash'. X-Git-Tag: 0.68~29 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=ac5b13398f47c99cc189eed4538abcccc3c18300;p=PuTTY.git lz77_compress: change scope of variable 'hash'. This makes it clearer that it doesn't persist beyond this block, and would have made it much more obvious that the assignment to it removed in the previous commit was pointless. --- diff --git a/sshzlib.c b/sshzlib.c index e7a4c63c..60447fdf 100644 --- a/sshzlib.c +++ b/sshzlib.c @@ -201,7 +201,7 @@ static void lz77_compress(struct LZ77Context *ctx, unsigned char *data, int len, int compress) { struct LZ77InternalContext *st = ctx->ictx; - int i, hash, distance, off, nmatch, matchlen, advance; + int i, distance, off, nmatch, matchlen, advance; struct Match defermatch, matches[MAXMATCH]; int deferchr; @@ -242,7 +242,7 @@ static void lz77_compress(struct LZ77Context *ctx, /* * Hash the next few characters. */ - hash = lz77_hash(data); + int hash = lz77_hash(data); /* * Look the hash up in the corresponding hash chain and see