summaryrefslogtreecommitdiffstats
path: root/xlib/xutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlib/xutil.c')
-rw-r--r--xlib/xutil.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlib/xutil.c b/xlib/xutil.c
index 267a624..0514d7a 100644
--- a/xlib/xutil.c
+++ b/xlib/xutil.c
@@ -68,7 +68,8 @@ XGetVisualInfo(
XVisualInfo *vinfo_template,
int *nitems_return)
{
- XVisualInfo *info = (XVisualInfo *) ckalloc(sizeof(XVisualInfo));
+ XVisualInfo *info = ckalloc(sizeof(XVisualInfo));
+
info->visual = DefaultVisual(display, 0);
info->visualid = info->visual->visualid;
info->screen = 0;
@@ -99,7 +100,7 @@ XGetVisualInfo(
|| ((vinfo_mask & VisualBlueMaskMask)
&& (vinfo_template->blue_mask != info->blue_mask))
) {
- ckfree((char *) info);
+ ckfree(info);
return NULL;
}