DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2279
Version: 1.3-current





Link: http://www.fltk.org/str.php?L2279
Version: 1.3-current
diff -Nru fltk-1.3.x-r6916/src/fl_utf.c fltk-1.3.x-r6916-patched/src/fl_utf.c
--- fltk-1.3.x-r6916/src/fl_utf.c       2009-09-18 04:00:33.000000000 +0800
+++ fltk-1.3.x-r6916-patched/src/fl_utf.c       2009-10-28 21:02:38.000000000 
+0800
@@ -779,7 +779,7 @@
     unsigned ret;
     length =
       MultiByteToWideChar(GetACP(), 0, src, srclen, buf, 1024);
-    if (length >= 1024) {
+    if ((length == 0)&&(GetLastError()==ERROR_INSUFFICIENT_BUFFER)) {
       length = MultiByteToWideChar(GetACP(), 0, src, srclen, 0, 0);
       buf = (wchar_t*)(malloc(length*sizeof(wchar_t)));
       MultiByteToWideChar(GetACP(), 0, src, srclen, buf, length);
@@ -795,7 +795,7 @@
     length = mbstowcs(buf, src, 1024);
     if (length >= 1024) {
       length = mbstowcs(0, src, 0)+1;
-      buf = (wchar_t*)(malloc(length*sizeof(unsigned short)));
+      buf = (wchar_t*)(malloc(length*sizeof(wchar_t)));
       mbstowcs(buf, src, length);
     }
     if (length >= 0) {
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to