From b51320ce9d182b935def16e0aae1493bf6de0f60 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 29 May 2004 00:46:47 +0000 Subject: [PATCH] Take character size into account when calculating buffer size for wxFileDataObject. (Fixes aborts from NTDLL.) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/ole/dataobj.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index 14da1ff70c..48377785a4 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -1037,13 +1037,13 @@ size_t wxFileDataObject::GetDataSize() const return 0; // inital size of DROPFILES struct + null byte - size_t sz = sizeof(DROPFILES) + 1; + size_t sz = sizeof(DROPFILES) + (1 * sizeof(wxChar)); size_t count = m_filenames.GetCount(); for ( size_t i = 0; i < count; i++ ) { // add filename length plus null byte - sz += m_filenames[i].Len() + 1; + sz += (m_filenames[i].Len() + 1) * sizeof(wxChar); } return sz;