[PATCH libinput 09/11] test: fix default axis value assignment

Peter Hutterer peter.hutterer at who-t.net
Tue Jul 21 22:09:29 PDT 2015


Was assigned to -1 if no custom axes were provided.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 test/litest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/litest.c b/test/litest.c
index db93bbe..5ab95f1 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -1223,6 +1223,9 @@ axis_replacement_value(struct axis_replacement *axes,
 {
 	struct axis_replacement *axis = axes;
 
+	if (!axes)
+		return false;
+
 	while (axis->evcode != -1) {
 		if (axis->evcode == evcode) {
 			*value = axis->value;
@@ -1267,9 +1270,6 @@ litest_auto_assign_value(struct litest_device *d,
 		break;
 	default:
 		value = -1;
-		if (!axes)
-			break;
-
 		if (!axis_replacement_value(axes, ev->code, &value) &&
 		    d->interface->get_axis_default)
 			d->interface->get_axis_default(d, ev->code, &value);
-- 
2.4.3



More information about the wayland-devel mailing list