Module Name: src
Committed By: macallan
Date: Thu Jul 12 01:21:08 UTC 2012
Modified Files:
src/sys/dev/wscons: wsdisplay_glyphcache.c
Log Message:
deal with negative cache sizes
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/wscons/wsdisplay_glyphcache.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/wscons/wsdisplay_glyphcache.c
diff -u src/sys/dev/wscons/wsdisplay_glyphcache.c:1.2 src/sys/dev/wscons/wsdisplay_glyphcache.c:1.3
--- src/sys/dev/wscons/wsdisplay_glyphcache.c:1.2 Thu Apr 19 08:46:17 2012
+++ src/sys/dev/wscons/wsdisplay_glyphcache.c Thu Jul 12 01:21:08 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay_glyphcache.c,v 1.2 2012/04/19 08:46:17 macallan Exp $ */
+/* $NetBSD: wsdisplay_glyphcache.c,v 1.3 2012/07/12 01:21:08 macallan Exp $ */
/*
* Copyright (c) 2012 Michael Lorenz
@@ -47,6 +47,7 @@ glyphcache_init(glyphcache *gc, int firs
gc->gc_cellheight = cellheight;
gc->gc_firstline = first;
gc->gc_cellsperline = width / cellwidth;
+ if (lines < 0) lines = 0;
cache_lines = lines / cellheight;
gc->gc_numcells = cache_lines * gc->gc_cellsperline;
if (gc->gc_numcells > 256)