From 0656ead9268e865f3aa9718ee0148920b4655832 Mon Sep 17 00:00:00 2001 From: kcgen Date: Sat, 22 Oct 2022 13:33:24 -0700 Subject: Fix potential loss-of-precision when reading in ManyMouse --- src/libs/manymouse/linux_evdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/manymouse/linux_evdev.c b/src/libs/manymouse/linux_evdev.c index fc768dc8c..c99500182 100644 --- a/src/libs/manymouse/linux_evdev.c +++ b/src/libs/manymouse/linux_evdev.c @@ -4,7 +4,9 @@ * Please see the file LICENSE.txt in the source's root directory. * * This file written by Ryan C. Gordon. - * Altered to silence compiler warnings by Roman Standzikowski. + * Altered to: + * - silence compiler warnings, by Roman Standzikowski. + * - silence compiler warnings, by kcgen. */ #include "manymouse.h" @@ -48,7 +50,7 @@ static int poll_mouse(MouseStruct *mouse, ManyMouseEvent *outevent) while (unhandled) /* read until failure or valid event. */ { struct input_event event; - int br = read(mouse->fd, &event, sizeof (event)); + const ssize_t br = read(mouse->fd, &event, sizeof (event)); if (br == -1) { if (errno == EAGAIN) -- cgit v1.2.3