From db97dd67d0d08b4b2b31e6b439fe7b858809882d Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 18 Jul 2009 09:33:30 +0000 Subject: [PATCH] Check bounds before, not after. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3296 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/client/console.c b/engine/client/console.c index be108bfb2..f7ca5b16a 100644 --- a/engine/client/console.c +++ b/engine/client/console.c @@ -994,7 +994,7 @@ static int Con_LineBreaks(conchar_t *start, conchar_t *end, int scrwidth, int ma // scan the width of the line for (px=0, l=0 ; px <= scrwidth;) { - if ((start[l]&CON_CHARMASK) == '\n' || (start+l >= end)) + if (start+l >= end || (start[l]&CON_CHARMASK) == '\n') break; l++; px += Font_CharWidth(start[l]);