fixed infinite-loop bug 17045 by conditioning control loop. r=buster

git-svn-id: svn://10.0.0.236/trunk@51627 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rickg%netscape.com
1999-10-23 03:06:19 +00:00
parent feca3d387f
commit a553c7ea86
4 changed files with 8 additions and 8 deletions

View File

@@ -122,7 +122,7 @@ PRInt32 nsStyleUtil::FindNextSmallerFontSize(nscoord aFontSize, PRInt32 aBasePoi
}
}
else { // smaller than HTML table
for (index = 0; ; index--)
for (index = 0; -25<index ; index--) //prevent infinite loop (bug 17045)
if (fontSize > NSTwipsToFloorIntPoints(CalcFontPointSize(index, aBasePointSize, aScalingFactor))) {
break;
}
@@ -149,7 +149,7 @@ PRInt32 nsStyleUtil::FindNextLargerFontSize(nscoord aFontSize, PRInt32 aBasePoin
}
}
else { // smaller than HTML table
for (index = 0; ; index--)
for (index = 0; -25<index ; index--) //prevent infinite loop (bug 17045)
if (fontSize > NSTwipsToFloorIntPoints(CalcFontPointSize(index, aBasePointSize, aScalingFactor))) {
index++;
break;