Commit 001aeb55 authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Ulrich Sibiller

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: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent 7ddc5b90
......@@ -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));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment