aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-03-08 15:37:33 -0800
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:26 +0200
commit001aeb55b16633ced88eec1fa3d1a5bf516c83f0 (patch)
tree808ae0b276d621e99769846194acfc0218b91af6 /nx-X11
parent7ddc5b90f200d3df70ca744d35507799334a8d9e (diff)
downloadnx-libs-001aeb55b16633ced88eec1fa3d1a5bf516c83f0.tar.gz
nx-libs-001aeb55b16633ced88eec1fa3d1a5bf516c83f0.tar.bz2
nx-libs-001aeb55b16633ced88eec1fa3d1a5bf516c83f0.zip
XAllocClassHint: Assume calloc sets pointers in allocated memory to NULL
While the C standard technically allows for the compiler to translate pointer = 0 or pointer = NULL into something other than filling the pointer address with 0 bytes, the rest of the Xlib code already assumes that calloc initializes any pointers in the struct to NULL, and there are no known systems supported by X.Org where this is not true. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/lib/X11/PropAlloc.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/nx-X11/lib/X11/PropAlloc.c b/nx-X11/lib/X11/PropAlloc.c
index bad768153..516283080 100644
--- a/nx-X11/lib/X11/PropAlloc.c
+++ b/nx-X11/lib/X11/PropAlloc.c
@@ -58,12 +58,7 @@ XWMHints *XAllocWMHints (void)
XClassHint *XAllocClassHint (void)
{
- register XClassHint *h;
-
- if ((h = (XClassHint *) Xcalloc (1, (unsigned) sizeof (XClassHint))))
- h->res_name = h->res_class = NULL;
-
- return h;
+ return Xcalloc (1, sizeof (XClassHint));
}