GetId was accessing the m_format var incorrectly

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-06-07 21:55:19 +00:00
parent 2f64c3bb23
commit 493ac0b8b5
2 changed files with 4 additions and 2 deletions

View File

@@ -84,6 +84,7 @@ void wxDataFormat::SetType( wxDataFormatId Type )
m_format = kDragFlavorTypeHFS ;
else
{
m_format = '????' ;
wxFAIL_MSG( wxT("invalid dataformat") );
}
}
@@ -96,7 +97,7 @@ wxDataFormatId wxDataFormat::GetType() const
wxString wxDataFormat::GetId() const
{
char text[5] ;
strncpy( text , (char*) m_format , 4 ) ;
strncpy( text , (char*) &m_format , 4 ) ;
text[4] = 0 ;
return wxString::FromAscii( text ) ;
}

View File

@@ -84,6 +84,7 @@ void wxDataFormat::SetType( wxDataFormatId Type )
m_format = kDragFlavorTypeHFS ;
else
{
m_format = '????' ;
wxFAIL_MSG( wxT("invalid dataformat") );
}
}
@@ -96,7 +97,7 @@ wxDataFormatId wxDataFormat::GetType() const
wxString wxDataFormat::GetId() const
{
char text[5] ;
strncpy( text , (char*) m_format , 4 ) ;
strncpy( text , (char*) &m_format , 4 ) ;
text[4] = 0 ;
return wxString::FromAscii( text ) ;
}