Check bounds before, not after.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3296 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
a55a2326f2
commit
db97dd67d0
1 changed files with 1 additions and 1 deletions
|
@ -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]);
|
||||
|
|
Loading…
Reference in a new issue