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
This commit is contained in:
Craig Rodrigues 2005-09-06 20:38:39 +00:00
parent ba5b359aef
commit 4506b763e0

View File

@ -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) {