Skip to content

Commit 90d94d0

Browse files
committed
nx-X11/programs/Xserver/hw/nxagent/Screen.c: let intersect() accept NULL pointers in case we're only interested in the boolean return value.
1 parent 39d5228 commit 90d94d0

File tree

1 file changed

+17
-5
lines changed
  • nx-X11/programs/Xserver/hw/nxagent

1 file changed

+17
-5
lines changed

nx-X11/programs/Xserver/hw/nxagent/Screen.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3670,13 +3670,25 @@ static Bool intersect(int ax1, int ay1, unsigned int aw, unsigned int ah,
36703670

36713671
return FALSE;
36723672
}
3673-
*x = ix;
3674-
*y = iy;
3675-
*w = iw;
3676-
*h = ih;
3673+
3674+
if (x) {
3675+
*x = ix;
3676+
}
3677+
3678+
if (y) {
3679+
*y = iy;
3680+
}
3681+
3682+
if (w) {
3683+
*w = iw;
3684+
}
3685+
3686+
if (h) {
3687+
*h = ih;
3688+
}
36773689

36783690
#ifdef DEBUG
3679-
fprintf(stderr, "intersect: intersection is: ([%d],[%d]) [ %d x %d ]\n", *x, *y, *w, *h);
3691+
fprintf(stderr, "intersect: intersection is: ([%d],[%d]) [ %d x %d ]\n", (x) ? *(x) : (-1), (y) ? (*y) : (-1), (w) ? (*w) : (-1), (h) ? (*h) : (-1));
36803692
#endif
36813693

36823694
return TRUE;

0 commit comments

Comments
 (0)