summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-05-03 14:34:22 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-06-07 13:28:27 +1000
commit89c7eff322c60d78c814693ecb28fa6c65159d3e (patch)
tree423c8d5e296edf0bec8a8be8413d386bb84891ce /src
parent7c6003718458ede0542233a213e05d67731d3e28 (diff)
XIChangeHierarchy: Return Success early if no actual changes are requested.
Do the same for negative num_changes. Found by static analyzer. Reported-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> (cherry picked from commit cc6feecae23b321952921cf927bc965386844c8c)
Diffstat (limited to 'src')
-rw-r--r--src/XIHierarchy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/XIHierarchy.c b/src/XIHierarchy.c
index d30ea29..09e6f93 100644
--- a/src/XIHierarchy.c
+++ b/src/XIHierarchy.c
@@ -52,6 +52,9 @@ XIChangeHierarchy(Display* dpy,
if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
return (NoSuchExtension);
+ if (num_changes <= 0)
+ return Success;
+
GetReq(XIChangeHierarchy, req);
req->reqType = info->codes->major_opcode;
req->ReqType = X_XIChangeHierarchy;