From f1c0f28bca98e63e949e75e63c2004a6a5f00099 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 1 Mar 2018 12:48:37 +1000 Subject: [PATCH] tools: fix two scan-build errors in libinput-record division by 0 and an unused variable Signed-off-by: Peter Hutterer --- tools/libinput-record.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/libinput-record.c b/tools/libinput-record.c index 73336957..f3170e1e 100644 --- a/tools/libinput-record.c +++ b/tools/libinput-record.c @@ -405,7 +405,7 @@ print_description(struct record_context *ctx, struct libevdev *dev) x = libevdev_get_abs_info(dev, ABS_X); y = libevdev_get_abs_info(dev, ABS_Y); if (x && y) { - if (x->resolution || y->resolution) { + if (x->resolution && y->resolution) { int w, h; w = (x->maximum - x->minimum)/x->resolution; @@ -788,7 +788,6 @@ mainloop(struct record_context *ctx) indent_pop(ctx); /* events: */ if (autorestart) { - d = list_first_entry(&ctx->devices, d, link); noiprintf(ctx, "# Closing after %ds inactivity", ctx->timeout/1000);