/[winpt]/trunk/Src/wptProxySettingsDlg.cpp
ViewVC logotype

Diff of /trunk/Src/wptProxySettingsDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2 by twoaday, Mon Jan 31 11:02:21 2005 UTC revision 13 by twoaday, Mon Apr 25 07:15:30 2005 UTC
# Line 30  Line 30 
30    
31    
32  static int  static int
33    check_number (HWND dlg, int id)
34    {
35        char buf[32];
36        size_t i;
37    
38        GetDlgItemText (dlg, id, buf, 31);
39        for (i=0; i < strlen (buf); i++) {
40            if (!isdigit (buf[i]))
41                return -1;
42        }
43        return 0;
44    }
45    
46    
47    static int
48  read_proxy (HWND dlg, keyserver_proxy_ctx * ctx)  read_proxy (HWND dlg, keyserver_proxy_ctx * ctx)
49  {  {
50      char t[512];      char t[512];
# Line 46  read_proxy (HWND dlg, keyserver_proxy_ct Line 61  read_proxy (HWND dlg, keyserver_proxy_ct
61          if (!strncmp (t, "http://", 7))          if (!strncmp (t, "http://", 7))
62              pos = 7;              pos = 7;
63          ctx->host = strdup (t + pos);          ctx->host = strdup (t + pos);
64        }    
65        if (check_number (dlg, IDC_PROXY_PORT)) {
66            msg_box (dlg, _("Invalid port number."), _("Proxy Settings"), MB_ERR);
67            return -1;
68      }      }
69    
70      ctx->port = GetDlgItemInt( dlg, IDC_PROXY_PORT, NULL, FALSE );      ctx->port = GetDlgItemInt( dlg, IDC_PROXY_PORT, NULL, FALSE );
71      if( ctx->port < 0 || ctx->port > 65535 ) {      if( ctx->port < 0 || ctx->port > 65535 ) {
72          msg_box( dlg, _("Please select a value from 0-65535 for the port"), _("Proxy Settings"), MB_INFO );          msg_box( dlg, _("Please select a value from 0-65535 for the port"), _("Proxy Settings"), MB_INFO );

Legend:
Removed from v.2  
changed lines
  Added in v.13

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26