diff --git a/ChangeLog b/ChangeLog index a692ec7..4a8e162 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-10-20 20:09 Alexander Malmberg + + * Tools/xpbs.m (-xProvideSelection:): Copy all characters and the + terminating nul in XG_COMPOUND_TEXT handling. + 2003-10-20 16:20 Alexander Malmberg * Tools/xpbs.m (+xSelectionNotify:): Don't call XGetAtomName() diff --git a/Tools/xpbs.m b/Tools/xpbs.m index 5060bc9..c8e6de3 100644 --- a/Tools/xpbs.m +++ b/Tools/xpbs.m @@ -986,9 +986,10 @@ xErrorHandler(Display *d, XErrorEvent *e) XCompoundTextStyle, &textProperty); if (status == Success) { + NSAssert(textProperty.format == 8, @"textProperty.format == 8"); numItems = textProperty.nitems; - data = malloc(numItems); - memcpy(data, textProperty.value, 1); + data = malloc(numItems + 1); + memcpy(data, textProperty.value, numItems + 1); XFree((void *)textProperty.value); } }