From 71a42145b678be623e30bd5bf55833a04f14376f Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 27 Oct 2014 19:00:36 +0100 Subject: Advance the request buffer by the right amount in XIChangeHierarchy c->length is in 4-byte units, dptr is a char *, so we need to advance dptr by 4 * length to get the position of the next HierarchyChangeInfo. Reviewed-by: Peter Hutterer Signed-off-by: Julien Cristau --- src/XIHierarchy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/XIHierarchy.c b/src/XIHierarchy.c index 39c3d1b..3d2b4f2 100644 --- a/src/XIHierarchy.c +++ b/src/XIHierarchy.c @@ -109,7 +109,7 @@ XIChangeHierarchy(Display* dpy, c->name_len = strlen(C->name); c->length = (sizeof(xXIAddMasterInfo) + c->name_len + 3)/4; strncpy((char*)&c[1], C->name, c->name_len); - dptr += c->length; + dptr += 4 * c->length; } break; case XIRemoveMaster: -- cgit v1.2.3