Correctly ignore extensions without events / errors

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2015-03-24 21:58:14 +01:00
parent c4f199fdae
commit 456a9a6f0c

View file

@ -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)