]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dialup.cpp
rename wxDECLARE_LOCAL_EVENT to just wxDECLARE_EVENT
[wxWidgets.git] / src / msw / dialup.cpp
index b708fb4612c07853dc7bec9c94ca604ae1ec7ee9..5232c49ce55cd8cdbfb07b54a1d1ae7463b0affe 100644 (file)
@@ -41,8 +41,8 @@
 
 #include "wx/dynlib.h"
 
-DEFINE_EVENT_TYPE(wxEVT_DIALUP_CONNECTED)
-DEFINE_EVENT_TYPE(wxEVT_DIALUP_DISCONNECTED)
+wxDEFINE_EVENT( wxEVT_DIALUP_CONNECTED, wxDialUpEvent )
+wxDEFINE_EVENT( wxEVT_DIALUP_DISCONNECTED, wxDialUpEvent )
 
 // Doesn't yet compile under VC++ 4, BC++, Watcom C++,
 // Wine: no wininet.h
@@ -709,7 +709,13 @@ size_t wxDialUpManagerMSW::GetISPNames(wxArrayString& names) const
         if ( dwRet == ERROR_BUFFER_TOO_SMALL )
         {
             // reallocate the buffer
-            rasEntries = (RASENTRYNAME *)realloc(rasEntries, size);
+            void *n  = realloc(rasEntries, size);
+            if (n == NULL)
+            {
+                free(rasEntries);
+                return 0;
+            }
+            rasEntries = (RASENTRYNAME *)n;
         }
         else if ( dwRet != 0 )
         {
@@ -801,7 +807,7 @@ bool wxDialUpManagerMSW::Dial(const wxString& nameOfISP,
 
     RASDIALPARAMS rasDialParams;
     rasDialParams.dwSize = sizeof(rasDialParams);
-    wxStrncpy(rasDialParams.szEntryName, entryName, RAS_MaxEntryName);
+    wxStrlcpy(rasDialParams.szEntryName, entryName.c_str(), RAS_MaxEntryName);
 
     // do we have the username and password?
     if ( !username || !password )
@@ -823,8 +829,8 @@ bool wxDialUpManagerMSW::Dial(const wxString& nameOfISP,
     }
     else
     {
-        wxStrncpy(rasDialParams.szUserName, username, UNLEN);
-        wxStrncpy(rasDialParams.szPassword, password, PWLEN);
+        wxStrlcpy(rasDialParams.szUserName, username.c_str(), UNLEN);
+        wxStrlcpy(rasDialParams.szPassword, password.c_str(), PWLEN);
     }
 
     // default values for other fields