[X2Go-Commits] [nx-libs] 02/10: nx-X11/programs/Xserver/hw/nxagent/Screen.c: let intersect() accept NULL pointers in case we're only interested in the boolean return value.

git-admin at x2go.org git-admin at x2go.org
Tue May 1 00:52:12 CEST 2018


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x-rpm-debug
in repository nx-libs.

commit 9c7fbefafd8fbcb0dd0e142053e781447af47765
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Mon Mar 19 06:18:51 2018 +0100

    nx-X11/programs/Xserver/hw/nxagent/Screen.c: let intersect() accept NULL pointers in case we're only interested in the boolean return value.
---
 nx-X11/programs/Xserver/hw/nxagent/Screen.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index ea305b8..22e6e15 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -3670,13 +3670,25 @@ static Bool intersect(int ax1, int ay1, unsigned int aw, unsigned int ah,
 
         return FALSE;
     }
-    *x = ix;
-    *y = iy;
-    *w = iw;
-    *h = ih;
+
+    if (x) {
+      *x = ix;
+    }
+
+    if (y) {
+      *y = iy;
+    }
+
+    if (w) {
+      *w = iw;
+    }
+
+    if (h) {
+      *h = ih;
+    }
 
     #ifdef DEBUG
-    fprintf(stderr, "intersect: intersection is: ([%d],[%d]) [ %d x %d ]\n", *x, *y, *w, *h);
+    fprintf(stderr, "intersect: intersection is: ([%d],[%d]) [ %d x %d ]\n", (x) ? *(x) : (-1), (y) ? (*y) : (-1), (w) ? (*w) : (-1), (h) ? (*h) : (-1));
     #endif
 
     return TRUE;

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list