From 001aeb55b16633ced88eec1fa3d1a5bf516c83f0 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 8 Mar 2013 15:37:33 -0800 Subject: 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 Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/PropAlloc.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'nx-X11/lib/X11/PropAlloc.c') 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)); } -- cgit v1.2.3