aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-12-02 22:55:50 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-05-07 14:58:17 +0200
commitfe39d8a38b7e0d9e634758cd1d22e6954f30fd0f (patch)
treeec30a0987be00c23e51c7053eeb6d3eae27098be /nx-X11/programs/Xserver
parentb65dd4e3094247560cae56ad00377387064c0627 (diff)
downloadnx-libs-fe39d8a38b7e0d9e634758cd1d22e6954f30fd0f.tar.gz
nx-libs-fe39d8a38b7e0d9e634758cd1d22e6954f30fd0f.tar.bz2
nx-libs-fe39d8a38b7e0d9e634758cd1d22e6954f30fd0f.zip
NXshm.c: slight simplification
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXshm.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
index c84e8e5a9..4784f4657 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
@@ -190,9 +190,6 @@ fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
char *data;
{
#ifdef NXAGENT_SERVER
- int length;
- char *newdata;
-
#ifdef TEST
fprintf(stderr, "fbShmPutImage: Called with drawable at [%p] GC at [%p] data at [%p].\n",
(void *) dst, (void *) pGC, (void *) data);
@@ -227,9 +224,9 @@ fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
sx, sy, sw, sh, dx);
#endif
- length = nxagentImageLength(sw, sh, format, 0, depth);
+ char *newdata = calloc(1, nxagentImageLength(sw, sh, format, 0, depth));
- if ((newdata = calloc(1, length)) != NULL)
+ if (newdata != NULL)
{
fbGetImage((DrawablePtr) pPixmap, sx, sy, sw, sh, format, AllPlanes, newdata);
(*pGC->ops->PutImage)(dst, pGC, depth, dx, dy, sw, sh, 0, format, newdata);