[PATCH weston] Fix an uninitialized variable

Pekka Paalanen ppaalanen at gmail.com
Mon Mar 19 10:15:36 UTC 2018


On Sun, 18 Mar 2018 00:20:29 -0400
Dima Ryazanov <dima at gmail.com> wrote:

> "has_discrete" gets set to true in if/else if, but gets left unset otherwise.
> So let's initialize it to false.
> 
> (This was caught by valgrind.)
> 
> Signed-off-by: Dima Ryazanov <dima at gmail.com>
> ---
>  libweston/compositor-wayland.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c
> index f51f78dd..111c4c09 100644
> --- a/libweston/compositor-wayland.c
> +++ b/libweston/compositor-wayland.c
> @@ -1707,6 +1707,7 @@ input_handle_axis(void *data, struct wl_pointer *pointer,
>  
>  	weston_event.axis = axis;
>  	weston_event.value = wl_fixed_to_double(value);
> +	weston_event.has_discrete = false;
>  
>  	if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL &&
>  	    input->vert.has_discrete) {

Nice, pushed:
   60970ec2..6b2fb180  master -> master

Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180319/862d25ef/attachment.sig>


More information about the wayland-devel mailing list