From 90d94d0b0b16d13b2b9476492e5438eef86da596 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Mon, 19 Mar 2018 06:18:51 +0100 Subject: [PATCH] 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 737e44037e..b349b85d3c 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;