summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvar Penning <post@0x21.biz>2020-07-27 22:03:13 +0200
committerAlvar Penning <post@0x21.biz>2020-07-31 12:53:46 +0200
commit744f20790cae868ee435dcceefdfa4c40fd21925 (patch)
tree3f608a722ad8e8080c4dd0910a55afca0554a826
parenta0bb84b20424390c51b2ea0516bb281032fd62e6 (diff)
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.
-rw-r--r--dwl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dwl.c b/dwl.c
index f7f88f1..30a45f1 100644
--- a/dwl.c
+++ b/dwl.c
@@ -762,7 +762,7 @@ focusstack(const Arg *arg)
Atom
getatom(xcb_connection_t *xc, const char *name)
{
- Atom atom;
+ Atom atom = 0;
xcb_generic_error_t *error;
xcb_intern_atom_cookie_t cookie;
xcb_intern_atom_reply_t *reply;