Silly error in loading Default Settings - reset port but not protocol
[sgt/putty] / windlg.c
index a1e463e..e7d58fd 100644 (file)
--- a/windlg.c
+++ b/windlg.c
@@ -42,8 +42,6 @@ static void mungestr(char *in, char *out) {
 }
 
 static void unmungestr(char *in, char *out) {
-    int candot = 0;
-
     while (*in) {
        if (*in == '%' && in[1] && in[2]) {
            int i, j;
@@ -226,7 +224,6 @@ static void load_settings (char *section, int do_host) {
     }
 
     free(p);
-    RegCloseKey(subkey1);
 
     if (do_host) {
        char prot[10];
@@ -238,6 +235,7 @@ static void load_settings (char *section, int do_host) {
        else
            cfg.protocol = PROT_TELNET;
     } else {
+       cfg.protocol = PROT_TELNET;
        cfg.port = 23;
        *cfg.host = '\0';
     }