From 5258c7342238b8da4ed91d26509badcb532dc23b Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Thu, 19 Oct 2000 21:57:17 +0000 Subject: [PATCH] #56769 r=mkaply, a=blizzard Code from jkobal to fix various clipboard problems --- widget/src/os2/nsClipboard.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widget/src/os2/nsClipboard.cpp b/widget/src/os2/nsClipboard.cpp index 607e0f96951..31dd0696a5a 100644 --- a/widget/src/os2/nsClipboard.cpp +++ b/widget/src/os2/nsClipboard.cpp @@ -106,12 +106,12 @@ PRBool nsClipboard::GetClipboardData(const char *aFlavour) const char* castText = NS_REINTERPRET_CAST(char*, pData); ULONG txtLen = strlen(castText) + 1; - PRUnichar* uniBuf = (UniChar*)PR_Malloc(txtLen); + PRUnichar* uniBuf = (PRUnichar*)PR_Malloc(txtLen*sizeof(PRUnichar)); PRUnichar* convertedText = gModuleData.ConvertToUcs(castText, uniBuf, txtLen); if (convertedText) { pData = NS_REINTERPRET_CAST(void*, convertedText); - cbData = txtLen * 2; + cbData = (txtLen-1) * sizeof(PRUnichar); } }