DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR Pending]
Link: http://www.fltk.org/str.php?L2277
Version: 1.3-current
Fix Version: 1.3.0 (r7925)
Link: http://www.fltk.org/str.php?L2277
Version: 1.3-current
Fix Version: 1.3.0 (r7925)
Index: src/Fl_x.cxx
===================================================================
--- src/Fl_x.cxx (revision 7979)
+++ src/Fl_x.cxx (working copy)
@@ -958,16 +958,22 @@
#ifndef X_HAVE_UTF8_STRING
text_list = (char**)&portion;
#else
- int list_count;
+ int list_count = 0;
Xutf8TextPropertyToTextList(fl_display, (const
XTextProperty*)&text_prop, &text_list, &list_count);
+
+ // If list_count is 0, then set text_list to portion and update
list_count to 1
+ if (!list_count) {
+ text_list = (char**)&portion;
+ list_count = 1;
+ }
#endif
int bytesnew = strlen(*text_list)+1;
buffer = (unsigned char*)realloc(buffer, bytesread+bytesnew+remaining);
memcpy(buffer+bytesread, *text_list, bytesnew);
- XFree(portion);
#ifdef X_HAVE_UTF8_STRING
- XFreeStringList(text_list);
+ if (text_list != (char**)&portion) XFreeStringList(text_list);
#endif
+ XFree(portion);
bytesread += bytesnew - 1;
if (!remaining) break;
}
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs