From 20c130a57835261e7e7327fe85e95c76c5fe31af Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 25 Dec 2014 01:32:10 +0000 Subject: [PATCH] Blind fix for wxTextDataObject trailing NUL under OS X. Use the length provided to SetData() instead of assuming it is NUL-terminated. Closes #9522. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/dobjcmn.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/dobjcmn.cpp b/src/common/dobjcmn.cpp index 5e4d43dcc0..10ba0a267a 100644 --- a/src/common/dobjcmn.cpp +++ b/src/common/dobjcmn.cpp @@ -284,12 +284,12 @@ bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const } bool wxTextDataObject::SetData(const wxDataFormat& format, - size_t WXUNUSED(len), const void *buf) + size_t len, const void *buf) { if ( buf == NULL ) return false; - wxWCharBuffer buffer = GetConv(format).cMB2WX( (const char*)buf ); + wxWCharBuffer buffer = GetConv(format).cMB2WC((const char*)buf, len, NULL); SetText( buffer );