diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2005-09-07 15:19:03 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2005-09-07 15:19:03 +0000 |
commit | ab91f18851fd9344eda8747adf864d11dc291f75 (patch) | |
tree | e54f75a77b5972f15401e20f06dd5ed22f354a1b /sys | |
parent | b5dafedcd720bd0052d9d213a23fa0db16c98e8d (diff) | |
download | FreeBSD-src-ab91f18851fd9344eda8747adf864d11dc291f75.zip FreeBSD-src-ab91f18851fd9344eda8747adf864d11dc291f75.tar.gz |
In set_mouse_pos(), try to avoid division by zero errors.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/syscons/scmouse.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/syscons/scmouse.c b/sys/dev/syscons/scmouse.c index 794a4ba..ef5c026 100644 --- a/sys/dev/syscons/scmouse.c +++ b/sys/dev/syscons/scmouse.c @@ -157,7 +157,8 @@ set_mouse_pos(scr_stat *scp) scp->mouse_ypos = (scp->ysize + scp->yoff)*scp->font_size - 1; } - if (scp->mouse_xpos != scp->mouse_oldxpos || scp->mouse_ypos != scp->mouse_oldypos) { + if ((scp->mouse_xpos != scp->mouse_oldxpos || scp->mouse_ypos != scp->mouse_oldypos) + && (scp->font_size != 0 && scp->font_width != 0)) { scp->status |= MOUSE_MOVED; scp->mouse_pos = (scp->mouse_ypos/scp->font_size - scp->yoff)*scp->xsize |