From: Simon Tatham Date: Tue, 14 Feb 2017 20:22:05 +0000 (+0000) Subject: Remove assorted dead code. X-Git-Tag: 0.68~30 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=f2e76e07dad155a2fdc68930a2e96d6aa2682391;p=PuTTY.git Remove assorted dead code. Assignments that are overwritten shortly afterwards and never used, and a completely unused variable. Also, the bogus array access in testbn.c could have actually accessed one beyond the array limit (though of course it's only in a test harness). --- diff --git a/import.c b/import.c index a00406ae..adf68777 100644 --- a/import.c +++ b/import.c @@ -1547,15 +1547,11 @@ struct ssh2_userkey *openssh_new_read(const Filename *filename, int i; struct ssh2_userkey *retval = NULL; const char *errmsg; - unsigned char *blob; - int blobsize = 0; unsigned checkint0, checkint1; const void *priv, *string; int privlen, stringlen, key_index; const struct ssh_signkey *alg = NULL; - blob = NULL; - if (!key) return NULL; @@ -1721,10 +1717,6 @@ struct ssh2_userkey *openssh_new_read(const Filename *filename, retkey = NULL; /* prevent the free */ error: - if (blob) { - smemclr(blob, blobsize); - sfree(blob); - } if (retkey) { sfree(retkey->comment); if (retkey->data) { diff --git a/sshzlib.c b/sshzlib.c index ee1bc42d..e7a4c63c 100644 --- a/sshzlib.c +++ b/sshzlib.c @@ -267,7 +267,6 @@ static void lz77_compress(struct LZ77Context *ctx, } } else { nmatch = 0; - hash = INVALID; } if (nmatch > 0) { diff --git a/testbn.c b/testbn.c index 15f3b980..576c18b7 100644 --- a/testbn.c +++ b/testbn.c @@ -82,8 +82,6 @@ int main(int argc, char **argv) val = val * 16 + fromxdigit(start[i+1]); *q++ = val; } - - ptrs[ptrnum] = q; } if (!strcmp(buf, "mul")) { diff --git a/windows/winutils.c b/windows/winutils.c index c49612e5..31b98d18 100644 --- a/windows/winutils.c +++ b/windows/winutils.c @@ -365,7 +365,7 @@ void split_into_argv(char *cmdline, int *argc, char ***argv, if (quotes > 0) { /* Outside a quote segment, a quote starts one. */ - if (!quote) quotes--, quote = 1; + if (!quote) quotes--; /* Now we produce (n+1)/3 literal quotes... */ for (i = 3; i <= quotes+1; i += 3) *q++ = '"';