]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/filedlg.cpp
split wxEVT_GRID_CELL_CHANGE into wxEVT_GRID_CELL_CHANGING/ED pair for consistency...
[wxWidgets.git] / src / msw / filedlg.cpp
index c618fe3629e93d0fe2910f4581c81810be99c4d3..d1bb4157092629ef348156ea617ce905186a05bb 100644 (file)
@@ -494,8 +494,7 @@ int wxFileDialog::ShowModal()
 
     //=== Setting defaultFileName >>=========================================
 
-    wxStrncpy(fileNameBuffer, m_fileName, wxMAXPATH-1);
-    fileNameBuffer[ wxMAXPATH-1 ] = wxT('\0');
+    wxStrlcpy(fileNameBuffer, m_fileName.c_str(), WXSIZEOF(fileNameBuffer));
 
     of.lpstrFile = fileNameBuffer;  // holds returned filename
     of.nMaxFile  = wxMAXPATH;
@@ -596,8 +595,7 @@ int wxFileDialog::ShowModal()
                 extension = extension + wxStrlen( extension ) + 1;
 
             m_fileName = AppendExtension(fileNameBuffer, extension);
-            wxStrncpy(fileNameBuffer, m_fileName.c_str(), wxMin(m_fileName.length(), wxMAXPATH-1));
-            fileNameBuffer[wxMin(m_fileName.length(), wxMAXPATH-1)] = wxT('\0');
+            wxStrlcpy(fileNameBuffer, m_fileName.c_str(), WXSIZEOF(fileNameBuffer));
         }
 
         m_path = fileNameBuffer;