From b15f88412bab17d947347fc968616b33d3131719 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 10 Mar 2018 22:04:07 -0500 Subject: [PATCH] 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. --- darwin/attrstr.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwin/attrstr.m b/darwin/attrstr.m index c53daae7..2c27f12c 100644 --- a/darwin/attrstr.m +++ b/darwin/attrstr.m @@ -250,7 +250,7 @@ static void addFontAttributeToRange(struct foreachParams *p, size_t start, size_ CFRange range; size_t diff; - while (start <= end) { + while (start < end) { cfa = (uiprivCombinedFontAttr *) CFAttributedStringGetAttribute(p->mas, start, combinedFontAttrName, &range); if (cfa == nil) cfa = [uiprivCombinedFontAttr new];