From 4506b763e03d66691555a3a5ce165bf0ee86cd3b Mon Sep 17 00:00:00 2001 From: Craig Rodrigues Date: Tue, 6 Sep 2005 20:38:39 +0000 Subject: In sc_set_text_mode(), reset fontwidth if it is <= 0. Eliminates division by zero errors in syscons driver. Reported by: keramida, Slawa Olhovchenkov , Kyryll Mirnenko Tested by: keramida, rodrigc --- sys/dev/syscons/scvidctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/syscons/scvidctl.c b/sys/dev/syscons/scvidctl.c index 62d46c27530f..dff5d8923a18 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) { -- cgit v1.3