summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2015-03-24 21:58:14 +0100
committerUli Schlachter <psychon@znc.in>2015-03-24 21:59:37 +0100
commit456a9a6f0c44bba9294ddae99e83463bef67ee95 (patch)
tree6661f92c9c0edce37c70bf59f4846677614da190
parentc4f199fdae69f7e9b0479ce1565fa1fba9fb5d24 (diff)
Correctly ignore extensions without events / errors
Signed-off-by: Uli Schlachter <psychon@znc.in>
-rw-r--r--src/xcb_errors.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/xcb_errors.c b/src/xcb_errors.c
index a48baf8..7594c31 100644
--- a/src/xcb_errors.c
+++ b/src/xcb_errors.c
@@ -153,7 +153,8 @@ const char *xcb_errors_get_name_for_event(xcb_errors_context_t *ctx,
{
struct extension_info_t *info = ctx->extensions;
- while (info && !IS_IN_RANGE(event_code, info->first_event, info->static_info.num_events))
+ while (info && (info->first_event == 0
+ || !IS_IN_RANGE(event_code, info->first_event, info->static_info.num_events)))
info = info->next;
if (info == NULL)
@@ -167,7 +168,8 @@ const char *xcb_errors_get_name_for_error(xcb_errors_context_t *ctx,
{
struct extension_info_t *info = ctx->extensions;
- while (info && !IS_IN_RANGE(error_code, info->first_error, info->static_info.num_errors))
+ while (info && (info->first_error == 0
+ || !IS_IN_RANGE(error_code, info->first_error, info->static_info.num_errors)))
info = info->next;
if (info == NULL)