[mutter/wip/carlosg/coverity-fixes: 6/13] backends/x11: Fix off by one in debug output




commit b3046cca2d435970527f5479abd53c28eea89922
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Oct 24 21:57:41 2021 +0200

    backends/x11: Fix off by one in debug output
    
    We are looking the atom name based on the wrong index, as the
    axis is incremented to cater for the extra CLUTTER_INPUT_AXIS_IGNORE
    value.
    
    CID: #1418330
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2061>

 src/backends/x11/meta-seat-x11.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c
index 2f2637ac81..0cfa2e510d 100644
--- a/src/backends/x11/meta-seat-x11.c
+++ b/src/backends/x11/meta-seat-x11.c
@@ -156,7 +156,9 @@ translate_valuator_class (Display             *xdisplay,
                                   class->resolution);
 
   g_debug ("Added axis '%s' (min:%.2f, max:%.2fd, res:%d) of device %d",
-           clutter_input_axis_atom_names[axis],
+           axis == CLUTTER_INPUT_AXIS_IGNORE ?
+             "Ignored" :
+             clutter_input_axis_atom_names[axis - 1],
            class->min,
            class->max,
            class->resolution,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]