getatom: fix potential uninitialized atom variable

The getatom function returns the atom variable, which is only
initialized in case of a success. This results in a maybe-uninitialized
warning/error. After this commit, now a zero value is returned in case
of error.
This commit is contained in:
Alvar Penning 2020-07-27 22:03:13 +02:00
parent a0bb84b204
commit 744f20790c

2
dwl.c
View File

@ -762,7 +762,7 @@ focusstack(const Arg *arg)
Atom Atom
getatom(xcb_connection_t *xc, const char *name) getatom(xcb_connection_t *xc, const char *name)
{ {
Atom atom; Atom atom = 0;
xcb_generic_error_t *error; xcb_generic_error_t *error;
xcb_intern_atom_cookie_t cookie; xcb_intern_atom_cookie_t cookie;
xcb_intern_atom_reply_t *reply; xcb_intern_atom_reply_t *reply;