aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11/OpenDis.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-10-13 14:02:51 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-10-13 14:02:51 +0200
commit133c91f732c6259fa9099100cd5b781d5b1cbfa1 (patch)
tree478aa88a8c42cbcb8221dd6680a16131556b49be /nx-X11/lib/X11/OpenDis.c
parent051d521f6e20761ba6831cecd91883da960fa931 (diff)
parenta9f623f0a63372ca0705e8394fadf514dec55b1c (diff)
downloadnx-libs-133c91f732c6259fa9099100cd5b781d5b1cbfa1.tar.gz
nx-libs-133c91f732c6259fa9099100cd5b781d5b1cbfa1.tar.bz2
nx-libs-133c91f732c6259fa9099100cd5b781d5b1cbfa1.zip
Merge branch 'uli42-pr/libX11_debian_backports' into 3.6.x
Attributes GH PR #215: https://github.com/ArcticaProject/nx-libs/pull/215
Diffstat (limited to 'nx-X11/lib/X11/OpenDis.c')
-rw-r--r--nx-X11/lib/X11/OpenDis.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/nx-X11/lib/X11/OpenDis.c b/nx-X11/lib/X11/OpenDis.c
index a17b8b161..4036572a8 100644
--- a/nx-X11/lib/X11/OpenDis.c
+++ b/nx-X11/lib/X11/OpenDis.c
@@ -549,9 +549,7 @@ fallback_success:
/*
* Now iterate down setup information.....
*/
- dpy->pixmap_format =
- (ScreenFormat *)Xmalloc(
- (unsigned) (dpy->nformats *sizeof(ScreenFormat)));
+ dpy->pixmap_format = Xcalloc(dpy->nformats, sizeof(ScreenFormat));
if (dpy->pixmap_format == NULL) {
OutOfMemory (dpy, setup);
return(NULL);
@@ -579,8 +577,7 @@ fallback_success:
/*
* next the Screen structures.
*/
- dpy->screens =
- (Screen *)Xmalloc((unsigned) dpy->nscreens*sizeof(Screen));
+ dpy->screens = Xcalloc(dpy->nscreens, sizeof(Screen));
if (dpy->screens == NULL) {
OutOfMemory (dpy, setup);
return(NULL);
@@ -622,8 +619,7 @@ fallback_success:
/*
* lets set up the depth structures.
*/
- sp->depths = (Depth *)Xmalloc(
- (unsigned)sp->ndepths*sizeof(Depth));
+ sp->depths = Xcalloc(sp->ndepths, sizeof(Depth));
if (sp->depths == NULL) {
OutOfMemory (dpy, setup);
return(NULL);
@@ -645,8 +641,7 @@ fallback_success:
dp->nvisuals = u.dp->nVisuals;
u.dp = (xDepth *) (((char *) u.dp) + sz_xDepth);
if (dp->nvisuals > 0) {
- dp->visuals =
- (Visual *)Xmalloc((unsigned)dp->nvisuals*sizeof(Visual));
+ dp->visuals = Xcalloc(dp->nvisuals, sizeof(Visual));
if (dp->visuals == NULL) {
OutOfMemory (dpy, setup);
return(NULL);
@@ -788,7 +783,7 @@ fallback_success:
dpy->xdefaults[reply.nItems] = '\0';
}
else if (reply.propertyType != None)
- _XEatData(dpy, reply.nItems * (reply.format >> 3));
+ _XEatDataWords(dpy, reply.length);
}
#if !USE_XCB
DeqAsyncHandler(dpy, &async);