diff options
author | Uli Schlachter <psychon@znc.in> | 2015-03-24 21:58:14 +0100 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2015-03-24 21:59:37 +0100 |
commit | 456a9a6f0c44bba9294ddae99e83463bef67ee95 (patch) | |
tree | 6661f92c9c0edce37c70bf59f4846677614da190 | |
parent | c4f199fdae69f7e9b0479ce1565fa1fba9fb5d24 (diff) |
Correctly ignore extensions without events / errors
Signed-off-by: Uli Schlachter <psychon@znc.in>
-rw-r--r-- | src/xcb_errors.c | 6 |
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) |