Rejig windlg.c:verify_ssh_host_key() to silence a warning.
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Tue, 6 Jan 2009 00:25:07 +0000 (00:25 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Tue, 6 Jan 2009 00:25:07 +0000 (00:25 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@8394 cda61777-01e9-0310-a592-d414129be87e

windows/windlg.c

index 8235110..beedeb2 100644 (file)
@@ -786,7 +786,7 @@ int verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
 
     if (ret == 0)                     /* success - key matched OK */
        return 1;
-    if (ret == 2) {                   /* key was different */
+    else if (ret == 2) {              /* key was different */
        int mbret;
        char *text = dupprintf(wrongmsg, appname, keytype, fingerprint,
                               appname);
@@ -802,9 +802,7 @@ int verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
            return 1;
        } else if (mbret == IDNO)
            return 1;
-        return 0;
-    }
-    if (ret == 1) {                   /* key was absent */
+    } else if (ret == 1) {            /* key was absent */
        int mbret;
        char *text = dupprintf(absentmsg, keytype, fingerprint, appname);
        char *caption = dupprintf(mbtitle, appname);
@@ -819,8 +817,8 @@ int verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
            return 1;
        } else if (mbret == IDNO)
            return 1;
-        return 0;
     }
+    return 0;  /* abandon the connection */
 }
 
 /*