tools: fix coverty "may be used uninitialized" warnings
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 21 Dec 2015 22:48:41 +0000 (08:48 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Sun, 3 Jan 2016 21:39:24 +0000 (07:39 +1000)
tools/libevdev-tweak-device.c:390: uninit_use_in_call: Using uninitialized
value "changes" when calling "parse_options_abs".

tools/libevdev-tweak-device.c:376: warning: 'led' may be used uninitialized in
this function

tools/libevdev-tweak-device.c:375: warning: 'axis' may be used uninitialized
in this function

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tools/libevdev-tweak-device.c

index 6066db0443da2634c11f91ecf95af57c631f9b6f..295f0cd90752898016b93af1d2d78b67634fc753 100644 (file)
@@ -372,11 +372,12 @@ main(int argc, char **argv)
        enum mode mode;
        const char *path;
        struct input_absinfo absinfo;
-       int axis;
-       int led;
+       int axis = -1;
+       int led = -1;
        int led_state = -1;
-       unsigned int changes; /* bitmask of changes */
-       int xres, yres;
+       unsigned int changes = 0; /* bitmask of changes */
+       int xres = 0,
+           yres = 0;
 
        mode = parse_options_mode(argc, argv, &path);
        switch (mode) {