summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2010-12-11 21:41:42 +0000
committerManolo Gouy <Manolo>2010-12-11 21:41:42 +0000
commit49002922629735d16a8ec280b57a22cb80d7c9a7 (patch)
tree0d97c7d6dfdc5f0bef084c9059f6a09db83c05e2 /src
parent554a50b33b3b24eaddc65d3cc01a727231a0beb1 (diff)
Fixed inexact value for last argument of two fl_utf8toUtf16() calls.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8012 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_win32.cxx2
-rw-r--r--src/fl_dnd_win32.cxx3
2 files changed, 2 insertions, 3 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 539e271ee..e8a09d2d0 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -559,7 +559,7 @@ void Fl::copy(const char *stuff, int len, int clipboard) {
EmptyClipboard();
HGLOBAL hMem = GlobalAlloc(GHND, utf16_len * 2 + 2); // moveable and zero'ed mem alloc.
LPVOID memLock = GlobalLock(hMem);
- fl_utf8toUtf16(fl_selection_buffer[clipboard], fl_selection_length[clipboard], (unsigned short*) memLock, utf16_len * 2);
+ fl_utf8toUtf16(fl_selection_buffer[clipboard], fl_selection_length[clipboard], (unsigned short*) memLock, utf16_len + 1);
GlobalUnlock(hMem);
SetClipboardData(CF_UNICODETEXT, hMem);
CloseClipboard();
diff --git a/src/fl_dnd_win32.cxx b/src/fl_dnd_win32.cxx
index 2deadd37d..7673af165 100644
--- a/src/fl_dnd_win32.cxx
+++ b/src/fl_dnd_win32.cxx
@@ -425,8 +425,7 @@ public:
int utf16_len = fl_utf8toUtf16(fl_selection_buffer[0], fl_selection_length[0], 0, 0);
HGLOBAL gh = GlobalAlloc( GHND, utf16_len * 2 + 2 );
char *pMem = (char*)GlobalLock( gh );
- fl_utf8toUtf16(fl_selection_buffer[0], fl_selection_length[0], (unsigned short*)pMem, utf16_len * 2);
- pMem[ 2*utf16_len ] = 0;
+ fl_utf8toUtf16(fl_selection_buffer[0], fl_selection_length[0], (unsigned short*)pMem, utf16_len + 1);
// HGLOBAL gh = GlobalAlloc( GHND| GMEM_SHARE,
// (fl_selection_length[0]+4) * sizeof(short)
// + sizeof(DROPFILES));