summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons/sysmouse.c
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2000-07-25 21:18:47 +0000
committermarkm <markm@FreeBSD.org>2000-07-25 21:18:47 +0000
commit12a237a692a81328f3f14927af016b53de12eabd (patch)
treed58170d695bea67ad11d489d9a5a743980675bfc /sys/dev/syscons/sysmouse.c
parent218edb7befe15334d4053ab8e1621558da5eccb0 (diff)
downloadFreeBSD-src-12a237a692a81328f3f14927af016b53de12eabd.zip
FreeBSD-src-12a237a692a81328f3f14927af016b53de12eabd.tar.gz
o Fix a horrible bug where small reads (< 8 bytes) would return the
wrong bytes. o Improve the public interface; use void* instead of char* or u_int64_t to pass arbitrary data around. Submitted by: kris ("horrible bug")
Diffstat (limited to 'sys/dev/syscons/sysmouse.c')
-rw-r--r--sys/dev/syscons/sysmouse.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/dev/syscons/sysmouse.c b/sys/dev/syscons/sysmouse.c
index 5c92b23..3f13de2 100644
--- a/sys/dev/syscons/sysmouse.c
+++ b/sys/dev/syscons/sysmouse.c
@@ -334,10 +334,7 @@ sysmouse_event(mouse_info_t *info)
sysmouse_tty);
}
- /* do the /dev/random device a favour */
- /* The nasty-looking cast is to force treatment of 8 u_chars */
- /* in buf as a u_int64_t */
- random_harvest(*((u_int64_t *)buf), 2, 0, RANDOM_MOUSE);
+ random_harvest(buf, sizeof(buf), 2, 0, RANDOM_MOUSE);
return mouse_status.flags;
}
OpenPOWER on IntegriCloud