diff --git a/tools/ei-demo-client.c b/tools/ei-demo-client.c index c69b81e..4bc8739 100644 --- a/tools/ei-demo-client.c +++ b/tools/ei-demo-client.c @@ -320,7 +320,8 @@ int main(int argc, char **argv) if (!e) break; - switch(ei_event_get_type(e)) { + enum ei_event_type type = ei_event_get_type(e); + switch(type) { case EI_EVENT_CONNECT: colorprint("connected\n"); break; @@ -486,7 +487,7 @@ int main(int argc, char **argv) case EI_EVENT_TOUCH_MOTION: { colorprint("touch %s %u %.2f/%.2f\n", - ei_event_get_type(e) == EI_EVENT_TOUCH_DOWN ? "down" : "motion", + type == EI_EVENT_TOUCH_DOWN ? "down" : "motion", ei_event_touch_get_id(e), ei_event_touch_get_x(e), ei_event_touch_get_y(e)); @@ -503,7 +504,11 @@ int main(int argc, char **argv) } break; default: - abort(); + { + colorprint("ERROR: Unhandled event type %u (%s)\n", + type, ei_event_type_to_string(type)); + } + break; } }