[PATCH 1/2] Xi: Don't rely on axisVal for QueryState

Thomas Jaeger ThJaeger at gmail.com
Wed Sep 23 10:01:35 PDT 2009


axisVal may contain garbage, so this lead to incorrect behavior
---
 Xi/queryst.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/Xi/queryst.c b/Xi/queryst.c
index 60ec32e..e0343f9 100644
--- a/Xi/queryst.c
+++ b/Xi/queryst.c
@@ -85,7 +85,6 @@ ProcXQueryDeviceState(ClientPtr client)
     xValuatorState *tv;
     xQueryDeviceStateReply rep;
     DeviceIntPtr dev;
-    double *values;
 
     REQUEST(xQueryDeviceStateReq);
     REQUEST_SIZE_MATCH(xQueryDeviceStateReq);
@@ -151,8 +150,8 @@ ProcXQueryDeviceState(ClientPtr client)
 	tv->num_valuators = v->numAxes;
 	tv->mode = v->mode;
 	buf += sizeof(xValuatorState);
-	for (i = 0, values = v->axisVal; i < v->numAxes; i++) {
-	    *((int *)buf) = *values++;
+	for (i = 0; i < v->numAxes; i++) {
+	    *((int *)buf) = dev->last.valuators[i];
 	    if (client->swapped) {
 		swapl((int *)buf, n);	/* macro - braces needed */
 	    }
-- 
1.6.3.3


--------------060704010707090901070003
Content-Type: text/x-patch;
 name="0002-Kill-off-axisVal-completely.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="0002-Kill-off-axisVal-completely.patch"



More information about the xorg-devel mailing list