fix another index overflow issue
authorMarkus Teich <markus.teich@stusta.mhn.de>
Mon, 16 Nov 2015 23:23:51 +0000 (00:23 +0100)
committerMarkus Teich <markus.teich@stusta.mhn.de>
Mon, 16 Nov 2015 23:23:51 +0000 (00:23 +0100)
sent.c

diff --git a/sent.c b/sent.c
index 6fd288b43da0853c574b8643ffe7e364ced5afa3..5e47815fb984b5f3a4023af7289231ee896af2ef 100644 (file)
--- a/sent.c
+++ b/sent.c
@@ -326,7 +326,8 @@ void getfontsize(Slide *s, unsigned int *width, unsigned int *height)
        for (j = NUMFONTSCALES - 1; j >= 0; j--)
                if (fonts[j]->h * lfac <= xw.uh)
                        break;
-       drw_setfontset(d, fonts[++j]);
+       LIMIT(j, 0, NUMFONTSCALES - 1);
+       drw_setfontset(d, fonts[j]);
 
        /* fit width */
        *width = 0;