summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Harris <pharris@opentext.com>2013-06-05 19:23:35 -0400
committerPeter Harris <pharris@opentext.com>2013-06-05 19:23:35 -0400
commit1fd79b1b4dccd26434022c4b532a69be40d34b0b (patch)
tree2195bb896e0ccaf91287efff4231d04a6495c255
parenta6222dff4361ee1ba69a4616157c60375390117d (diff)
XI/ChangeFeedbackControl: Always set f
XChangeFeedbackControl will SEGV if the last parameter is NULL. Signed-off-by: Peter Harris <pharris@opentext.com>
-rw-r--r--xts5/XI/ChangeFeedbackControl.m21
1 files changed, 21 insertions, 0 deletions
diff --git a/xts5/XI/ChangeFeedbackControl.m b/xts5/XI/ChangeFeedbackControl.m
index e240e677..8b6ec3cf 100644
--- a/xts5/XI/ChangeFeedbackControl.m
+++ b/xts5/XI/ChangeFeedbackControl.m
@@ -572,6 +572,16 @@ Do a ChangeFeedbackControl, specifying a device that has no feedbacks.
if (Setup_Extension_DeviceInfo(NFeedMask))
{
+ XBellFeedbackControl belf;
+ belf.class = BellFeedbackClass;
+ belf.length = sizeof (XBellFeedbackControl);
+ belf.pitch = 0;
+ belf.id = 0;
+ belf.percent = -2;
+ belf.pitch = 0;
+ belf.duration = 100;
+ f = (XFeedbackControl *) &belf;
+
device = Devs.NoFeedback;
XCALL;
if (geterr() == BadMatch)
@@ -592,6 +602,7 @@ Do a ChangeFeedbackControl, specifying an invalid device.
XDevice bogus;
int baddevice;
int ximajor, first, err;
+XBellFeedbackControl belf;
if (!XQueryExtension (display, INAME, &ximajor, &first, &err)) {
untested("%s: Input extension not supported.\n", TestName);
@@ -601,6 +612,16 @@ int ximajor, first, err;
BadDevice (display, baddevice);
bogus.device_id = -1;
device = &bogus;
+
+ belf.class = BellFeedbackClass;
+ belf.length = sizeof (XBellFeedbackControl);
+ belf.pitch = 0;
+ belf.id = 0;
+ belf.percent = -2;
+ belf.pitch = 0;
+ belf.duration = 100;
+ f = (XFeedbackControl *) &belf;
+
XCALL;
if (geterr() == baddevice)
CHECK;