diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2005-09-06 20:38:39 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2005-09-06 20:38:39 +0000 |
commit | 72540a43caf90d67d277898c0be2efd658236454 (patch) | |
tree | edf08650286afe105b8023f7931bde4a46076bc3 /sys/dev/syscons/scvidctl.c | |
parent | 747ac2dc2053120c6e653d5dc0310467bf3c941f (diff) | |
download | FreeBSD-src-72540a43caf90d67d277898c0be2efd658236454.zip FreeBSD-src-72540a43caf90d67d277898c0be2efd658236454.tar.gz |
In sc_set_text_mode(), reset fontwidth if it is <= 0.
Eliminates division by zero errors in syscons driver.
Reported by: keramida, Slawa Olhovchenkov <slw at zxy dot spb dot ru>,
Kyryll Mirnenko <mirya at matrix dot kiev dot ua>
Tested by: keramida, rodrigc
Diffstat (limited to 'sys/dev/syscons/scvidctl.c')
-rw-r--r-- | sys/dev/syscons/scvidctl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/syscons/scvidctl.c b/sys/dev/syscons/scvidctl.c index 62d46c2..dff5d89 100644 --- a/sys/dev/syscons/scvidctl.c +++ b/sys/dev/syscons/scvidctl.c @@ -145,6 +145,8 @@ sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize, return ENODEV; /* adjust argument values */ + if (fontwidth <= 0) + fontwidth = info.vi_cwidth; if (fontsize <= 0) fontsize = info.vi_cheight; if (fontsize < 14) { |