[PATCH libevdev 1/3] tools: fix coverty "may be used uninitialized" warnings

Benjamin Tissoires benjamin.tissoires at gmail.com
Mon Jan 4 00:02:56 PST 2016


On Tue, Dec 22, 2015 at 1:01 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> 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 at who-t.net>
> ---

Not sure if it still matters:
quickly Reviewed-by: Benjamin Tissoires <benjamin.tissoires at gmail.com>

Cheers,
Benjamin

>  tools/libevdev-tweak-device.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/libevdev-tweak-device.c b/tools/libevdev-tweak-device.c
> index 6066db0..4be2d6f 100644
> --- a/tools/libevdev-tweak-device.c
> +++ b/tools/libevdev-tweak-device.c
> @@ -372,10 +372,10 @@ 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 */
> +       unsigned int changes = 0; /* bitmask of changes */
>         int xres, yres;
>
>         mode = parse_options_mode(argc, argv, &path);
> --
> 2.5.0
>
> _______________________________________________
> Input-tools mailing list
> Input-tools at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/input-tools


More information about the Input-tools mailing list