summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar John F. Carr <jfc@mit.edu>1991-08-08 03:53:13 +0000
committerGravatar John F. Carr <jfc@mit.edu>1991-08-08 03:53:13 +0000
commit8878dea2cb4586e81b383b2e5ffe751a00b705cc (patch)
treebb906e6b236e5f33815b99de0b52bc0a5d8ca0eb
parentaec86bda0a49ca04ce156f4ae28e16e4c3c72266 (diff)
Don't dump core on ICCCM violations.
-rw-r--r--zwgc/xselect.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/zwgc/xselect.c b/zwgc/xselect.c
index 85303a2..f691514 100644
--- a/zwgc/xselect.c
+++ b/zwgc/xselect.c
@@ -111,9 +111,17 @@ static void xselSetProperties(dpy,w,property,target,selreq)
} else if (target==XA_STRING) {
char *selected;
- selected=getSelectedText();
-
- ChangeProp(XA_STRING,8,selected,string_Length(selected));
+ if (selected = getSelectedText()) {
+ ChangeProp(XA_STRING,8,selected,string_Length(selected));
+ } else {
+ /* This should only happen if the pasting client is out of
+ spec (or if this program is buggy), but it could happen */
+#ifdef DEBUG
+ fprintf(stderr,
+ "SelectionRequest event received for unowned selection: requestor wid=0x%x", w);
+#endif
+ ChangeProp(XA_STRING,8,"",0);
+ }
XSync(dpy,0);
}