summaryrefslogtreecommitdiff
path: root/xserver/mi/miexpose.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2013-06-07 17:28:57 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2013-06-07 17:28:57 +0000
commitc0190187060808fe0ad2a09b31f4244757572ff9 (patch)
treeb028697436476ae3ff34218b0b233a233d8a7818 /xserver/mi/miexpose.c
parent33eda071f5846d332b428de759c5b1649e9cf1ba (diff)
Update to X server 1.14.1. Tested by many during t2k13. Thanks.
Diffstat (limited to 'xserver/mi/miexpose.c')
-rw-r--r--xserver/mi/miexpose.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/xserver/mi/miexpose.c b/xserver/mi/miexpose.c
index dbb29ca4a..8b7c93fb8 100644
--- a/xserver/mi/miexpose.c
+++ b/xserver/mi/miexpose.c
@@ -327,7 +327,7 @@ miSendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable,
numRects = RegionNumRects(pRgn);
pBox = RegionRects(pRgn);
- if (!(pEvent = malloc(numRects * sizeof(xEvent))))
+ if (!(pEvent = calloc(numRects, sizeof(xEvent))))
return;
pe = pEvent;
@@ -349,13 +349,12 @@ miSendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable,
free(pEvent);
}
else {
- xEvent event;
-
- memset(&event, 0, sizeof(xEvent));
+ xEvent event = {
+ .u.noExposure.drawable = drawable,
+ .u.noExposure.majorEvent = major,
+ .u.noExposure.minorEvent = minor
+ };
event.u.u.type = NoExpose;
- event.u.noExposure.drawable = drawable;
- event.u.noExposure.majorEvent = major;
- event.u.noExposure.minorEvent = minor;
WriteEventsToClient(client, 1, &event);
}
}