diff options
author | Eduardo Sánchez Muñoz <esm@eduardosm.net> | 2020-03-02 18:59:45 +0100 |
---|---|---|
committer | Eduardo Sánchez Muñoz <esm@eduardosm.net> | 2020-03-02 19:01:41 +0100 |
commit | 704e0a91b1dece9a4cce7cfe8beaeb86a5e14267 (patch) | |
tree | fbfb18809bedcb24dceb8a302d8512ad52c066f2 /src/xcb_xid.c | |
parent | 4b40b44cb6d088b6ffa2fb5cf3ad8f12da588cef (diff) |
Use the 'present' field to properly check that the XC-MISC
extension is available in xcb_generate_id.
Also document the returned value when xcb_generate_id fails.
Diffstat (limited to 'src/xcb_xid.c')
-rw-r--r-- | src/xcb_xid.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xcb_xid.c b/src/xcb_xid.c index 79a9a27..ebe41a1 100644 --- a/src/xcb_xid.c +++ b/src/xcb_xid.c @@ -55,7 +55,7 @@ uint32_t xcb_generate_id(xcb_connection_t *c) /* check for extension */ const xcb_query_extension_reply_t *xc_misc_reply = xcb_get_extension_data(c, &xcb_xc_misc_id); - if (!xc_misc_reply) { + if (!xc_misc_reply || !xc_misc_reply->present) { pthread_mutex_unlock(&c->xid.lock); return -1; } |