Skip to content
Snippets Groups Projects
Commit 9937fd32 authored by George Nachman's avatar George Nachman
Browse files

Don't go into an infinite loop when trying to convert positions with w idth of...

Don't go into an infinite loop when trying to convert positions with w idth of 0. Hopefully fixes issue 6005
parent c5c7b1d4
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -1338,8 +1338,10 @@ static int Search(NSString* needle,
- (BOOL)convertPosition:(int)position
withWidth:(int)width
toX:(int*)x
toY:(int*)y
{
toY:(int*)y {
if (width <= 0) {
return NO;
}
int i;
*x = 0;
*y = 0;
Loading
Loading
Loading
Loading
@@ -764,8 +764,10 @@ static int RawNumLines(LineBuffer* buffer, int width) {
}
 
// Returns an array of XRange values
- (NSArray*)convertPositions:(NSArray*)resultRanges withWidth:(int)width
{
- (NSArray*)convertPositions:(NSArray*)resultRanges withWidth:(int)width {
if (width <= 0) {
return nil;
}
// Create sorted array of all positions to convert.
NSMutableArray* unsortedPositions = [NSMutableArray arrayWithCapacity:[resultRanges count] * 2];
for (ResultRange* rr in resultRanges) {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment