Skip to content

Commit

Permalink
Don't call exit() in xcb_aux_get_depth; return 0 instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Harris committed Nov 29, 2008
1 parent 0d1e2f9 commit c9796f2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions aux/xcb_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,15 @@ xcb_aux_get_depth (xcb_connection_t *c,
{
xcb_drawable_t drawable;
xcb_get_geometry_reply_t *geom;
int depth;
int depth = 0;

drawable = screen->root;
geom = xcb_get_geometry_reply (c, xcb_get_geometry(c, drawable), 0);

if (!geom) {
perror ("GetGeometry(root) failed");
exit (0);
if (geom) {
depth = geom->depth;
free (geom);
}

depth = geom->depth;
free (geom);

return depth;
}
Expand Down

0 comments on commit c9796f2

Please sign in to comment.