Author: manolo
Date: 2010-12-11 13:41:42 -0800 (Sat, 11 Dec 2010)
New Revision: 8012
Log:
Fixed inexact value for last argument of two fl_utf8toUtf16() calls.

Modified:
   branches/branch-1.3/src/Fl_win32.cxx
   branches/branch-1.3/src/fl_dnd_win32.cxx

Modified: branches/branch-1.3/src/Fl_win32.cxx
===================================================================
--- branches/branch-1.3/src/Fl_win32.cxx        2010-12-11 20:28:43 UTC (rev 
8011)
+++ branches/branch-1.3/src/Fl_win32.cxx        2010-12-11 21:41:42 UTC (rev 
8012)
@@ -559,7 +559,7 @@
       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();

Modified: branches/branch-1.3/src/fl_dnd_win32.cxx
===================================================================
--- branches/branch-1.3/src/fl_dnd_win32.cxx    2010-12-11 20:28:43 UTC (rev 
8011)
+++ branches/branch-1.3/src/fl_dnd_win32.cxx    2010-12-11 21:41:42 UTC (rev 
8012)
@@ -425,8 +425,7 @@
       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));

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to