void wxFileDialog::SetPath(const wxString& path)
{
wxString ext;
- wxSplitPath(path, &m_dir, &m_fileName, &ext);
+ wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
if ( !ext.empty() )
m_fileName << _T('.') << ext;
}
//=== 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;
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;