diff --git a/ChangeLog b/ChangeLog index 032b0c5c1..470f209d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-05-25 Richard Frith-Macdonald + + * Source/NSIndexSet.m: ([addIndexesInRange:]) fix bug finding insertion + point for new range. ([description]) check for uninitialised instance. + 2004-05-24 Richard Frith-Macdonald * Source/NSDate.m: Implement -hash for abstract class and for the diff --git a/Source/NSIndexSet.m b/Source/NSIndexSet.m index 83298f384..26128707e 100644 --- a/Source/NSIndexSet.m +++ b/Source/NSIndexSet.m @@ -209,7 +209,7 @@ static unsigned posForIndex(GSIArray array, unsigned index) - (NSString*) description { NSMutableString *m; - unsigned c = GSIArrayCount(_array); + unsigned c = (_array == 0) ? 0 : GSIArrayCount(_array); unsigned i; m = [NSMutableString stringWithFormat: @@ -630,7 +630,7 @@ static unsigned posForIndex(GSIArray array, unsigned index) } else { - NSRange r = GSIArrayItemAtIndex(_array, pos-1).ext; + NSRange r = GSIArrayItemAtIndex(_array, pos).ext; if (NSLocationInRange(aRange.location, r)) {