diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2005-11-14 15:55:02 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2005-11-14 15:55:02 (GMT) |
commit | 79fa95b78c49d6f9eb5110b8d39a0e1a6c1416e4 (patch) | |
tree | 05a755182db25ebd0c7649494a9ad4b8b79c1b1c | |
parent | 27bac57088c784844c142294a294d8949b62c414 (diff) | |
download | tk-79fa95b78c49d6f9eb5110b8d39a0e1a6c1416e4.zip tk-79fa95b78c49d6f9eb5110b8d39a0e1a6c1416e4.tar.gz tk-79fa95b78c49d6f9eb5110b8d39a0e1a6c1416e4.tar.bz2 |
Oops! Very stupid typo.
-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; } |