Fixed the infinite loop: end is exclusive, and my code was correct in handling that, so <= (which i though was needed there because I thought the code wouldn't handle it) is wrong. Now for a segfault.

This commit is contained in:
Pietro Gagliardi 2018-03-10 22:04:07 -05:00
parent 1fae3eea02
commit b15f88412b
1 changed files with 1 additions and 1 deletions

View File

@ -250,7 +250,7 @@ static void addFontAttributeToRange(struct foreachParams *p, size_t start, size_
CFRange range; CFRange range;
size_t diff; size_t diff;
while (start <= end) { while (start < end) {
cfa = (uiprivCombinedFontAttr *) CFAttributedStringGetAttribute(p->mas, start, combinedFontAttrName, &range); cfa = (uiprivCombinedFontAttr *) CFAttributedStringGetAttribute(p->mas, start, combinedFontAttrName, &range);
if (cfa == nil) if (cfa == nil)
cfa = [uiprivCombinedFontAttr new]; cfa = [uiprivCombinedFontAttr new];