Various bug/warning fixes from Jacob
[u/mdw/putty] / windlg.c
index fb5740f..d6fce02 100644 (file)
--- a/windlg.c
+++ b/windlg.c
@@ -3,6 +3,7 @@
 #include <commdlg.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <ctype.h>
 
 #include "ssh.h"
 #include "putty.h"
@@ -66,6 +67,11 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg,
                 int *selitems;
                 selcount = SendDlgItemMessage(hwnd, IDN_LIST,
                                               LB_GETSELCOUNT, 0, 0);
+                if (selcount == 0) {   /* don't even try to copy zero items */
+                    MessageBeep(0);
+                    break;
+                }
+                    
                 selitems = smalloc(selcount * sizeof(int));
                 if (selitems) {
                     int count = SendDlgItemMessage(hwnd, IDN_LIST,
@@ -942,7 +948,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) {
         beginbox(&cp, "Sending of null packets to keep session active",
                  IDC_BOX_CONNECTION2);
         staticedit(&cp, "Seconds between &keepalives (0 to turn off)",
-                   IDC_PINGSTATIC, IDC_PINGEDIT, 25);
+                   IDC_PINGSTATIC, IDC_PINGEDIT, 20);
         endbox(&cp);
     }
 
@@ -1963,8 +1969,6 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg,
 
 static int CALLBACK MainDlgProc (HWND hwnd, UINT msg,
                                 WPARAM wParam, LPARAM lParam) {
-    static HWND page = NULL;
-
     if (msg == WM_COMMAND && LOWORD(wParam) == IDOK) {
     }
     if (msg == WM_COMMAND && LOWORD(wParam) == IDCX_ABOUT) {
@@ -1979,7 +1983,6 @@ static int CALLBACK MainDlgProc (HWND hwnd, UINT msg,
 
 static int CALLBACK ReconfDlgProc (HWND hwnd, UINT msg,
                                   WPARAM wParam, LPARAM lParam) {
-    static HWND page;
     return GenericMainDlgProc (hwnd, msg, wParam, lParam, 1);
 }