Fix assertion (off-by-one)

This commit is contained in:
Allan Odgaard
2013-08-04 19:40:36 +02:00
parent f4828036fe
commit 993bcaa26f

View File

@@ -9,7 +9,7 @@ NSAttributedString* AttributedStringWithMarkedUpRanges (std::string const& in, s
{
NSMutableAttributedString* res = [[NSMutableAttributedString alloc] init];
NSDictionary* highlightAttrs = @{ FLMatchingTextAttributeName : [NSNull null] };
ASSERT(offset >= 0 && offset < in.size());
ASSERT_LE(offset, in.size());
std::string text(in);
if(offset > 0)