diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-03-08 14:41:21 +1000 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-03-27 22:33:58 -0700 |
commit | a96fd08b406b9955ff0d5c02f4a50f4fb2acf40e (patch) | |
tree | 78deee91205db70c062cbaf463d56d8e5568c292 | |
parent | 09f6d85b5bb49406f015ec667bb6efb3e710ced2 (diff) |
Xi: fix XI2 passive grab reply length calculation
If modifiers failed, the reply length was 4 bytes too short.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 33fee13361e745e1db29e250b08622c83046d488)
-rw-r--r-- | Xi/xipassivegrab.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index e99b6e554..4b71c688a 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -194,7 +194,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) info->status = status; info->modifiers = *modifiers; rep.num_modifiers++; - rep.length++; + rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo)); } } @@ -202,7 +202,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) if (rep.num_modifiers) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, rep.num_modifiers * 4, (char*)modifiers_failed); + WriteSwappedDataToClient(client, rep.length * 4, (char*)modifiers_failed); } free(modifiers_failed); return ret; |