]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Remove assorted dead code.
authorSimon Tatham <anakin@pobox.com>
Tue, 14 Feb 2017 20:22:05 +0000 (20:22 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 14 Feb 2017 22:18:01 +0000 (22:18 +0000)
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).

import.c
sshzlib.c
testbn.c
windows/winutils.c

index a00406aeb83e71f7600953568e9cf3909b437d1f..adf68777dcd96de71faef9e3de49f5a0aed0ddf1 100644 (file)
--- 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) {
index ee1bc42d3054b8707ea41ffa04da5719048ec205..e7a4c63cb97ad1b2233b694e264477bed49e6bdc 100644 (file)
--- 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) {
index 15f3b9806438f0a2a9f68c1fbf323124d26a3d4f..576c18b79ef9d8aab9b6c909a7f6235198ef5e7f 100644 (file)
--- 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")) {
index c49612e535795a066bcaee0f960bdb59c5d818f2..31b98d18620a055e1d9bbf05fe5a25c640ad2861 100644 (file)
@@ -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++ = '"';