Use memcpy instead of strcpy.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
d4445d24d3
commit
f7570f5771
@ -243,12 +243,15 @@ size_t wxTextDataObject::GetDataSize(const wxDataFormat& format) const
|
||||
|
||||
bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const
|
||||
{
|
||||
if ( buf == NULL )
|
||||
if ( !buf )
|
||||
return false;
|
||||
|
||||
wxCharBuffer buffer = GetConv(format).cWX2MB( GetText().c_str() );
|
||||
if ( !buffer )
|
||||
return false;
|
||||
|
||||
strcpy( (char*)buf, buffer );
|
||||
memcpy( (char*) buf, buffer, GetDataSize(format) );
|
||||
// strcpy( (char*) buf, buffer );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user