diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2005-11-14 15:55:02 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2005-11-14 15:55:02 (GMT) |
commit | a7898a08aa4a1b0bba758bf62d0842d570e668c3 (patch) | |
tree | 05a755182db25ebd0c7649494a9ad4b8b79c1b1c /unix | |
parent | a7291cc35c9057e8853001ec9dfa09005e5ead25 (diff) | |
download | tk-a7898a08aa4a1b0bba758bf62d0842d570e668c3.zip tk-a7898a08aa4a1b0bba758bf62d0842d570e668c3.tar.gz tk-a7898a08aa4a1b0bba758bf62d0842d570e668c3.tar.bz2 |
Oops! Very stupid typo.
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tkUnixSelect.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/unix/tkUnixSelect.c b/unix/tkUnixSelect.c index cf2813d..9cef53b 100644 --- a/unix/tkUnixSelect.c +++ b/unix/tkUnixSelect.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixSelect.c,v 1.17 2005/11/13 23:40:04 dkf Exp $ + * RCS: @(#) $Id: tkUnixSelect.c,v 1.18 2005/11/14 15:55:02 dkf Exp $ */ #include "tkInt.h" @@ -453,12 +453,14 @@ TkSelPropProc(eventPtr) formatType, (Tk_Window) incrPtr->winPtr, &numItems); + if (propPtr == NULL) { + numItems = 0; + } + XChangeProperty(eventPtr->xproperty.display, + eventPtr->xproperty.window, eventPtr->xproperty.atom, + formatType, 32, PropModeReplace, + (unsigned char *) propPtr, numItems); if (propPtr != NULL) { - XChangeProperty(eventPtr->xproperty.display, - eventPtr->xproperty.window, - eventPtr->xproperty.atom, formatType, 32, - PropModeReplace, (unsigned char *) propPtr, - numItems); ckfree(propPtr); } } @@ -989,13 +991,14 @@ ConvertSelection( } else { propPtr = (char *) SelCvtToX((char *) buffer, type, (Tk_Window) winPtr, &numItems); - if (propPtr != NULL) { - format = 32; - XChangeProperty(reply.display, reply.requestor, property, type, - format, PropModeReplace, (unsigned char *) propPtr, - numItems); - ckfree(propPtr); + if (propPtr == NULL) { + goto refuse; } + format = 32; + XChangeProperty(reply.display, reply.requestor, property, type, + format, PropModeReplace, (unsigned char *) propPtr, + numItems); + ckfree(propPtr); } } @@ -1437,7 +1440,7 @@ SelCvtToX( * Release the parsed list. */ - ckfree((char *) &field); + ckfree((char *) field); *numLongsPtr = i; return propPtr; } |