From f7570f5771dc963279ad2745fcb2fa1ca8eb0763 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 30 Mar 2006 09:53:15 +0000 Subject: [PATCH] Use memcpy instead of strcpy. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/dobjcmn.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/dobjcmn.cpp b/src/common/dobjcmn.cpp index cbed32d72f..675ebdf2c0 100644 --- a/src/common/dobjcmn.cpp +++ b/src/common/dobjcmn.cpp @@ -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; } -- 2.45.2