cvs commit: src/sys/dev/usb ums.c
Florent Thoumie
flz at xbsd.org
Thu Dec 29 10:19:12 PST 2005
On Thursday 29 December 2005 18:44, Alexander Leidinger wrote:
> netchild 2005-12-29 17:44:40 UTC
>
> FreeBSD src repository
>
> Modified files:
> sys/dev/usb ums.c
> Log:
> Merge NetBSD rev. 1.61:
> - Support more than 7 buttons for USB mice. Patch from NetBSD
> kern/30248.
I was looking at this PR two or three days ago and I found this in ums.c
which made me think this simple patch could be harmful.
u_char buttons = 0;
int i;
[...]
#define UMS_BUT(i) ((i) < 3 ? (((i) + 2) % 3) : (i))
[...]
for (i = 0; i < sc->nbuttons; i++)
if (hid_get_data(ibuf, &sc->sc_loc_btn[i]))
buttons |= (1 << UMS_BUT(i));
I think this won't fit in u_char, what about uint32_t ?
--
Florent Thoumie
flz at FreeBSD.org
FreeBSD Committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20051229/6138d2f0/attachment.bin
More information about the cvs-src
mailing list