iFix in describing strings

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7455 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-09-09 04:56:50 +00:00
parent f11c42d09a
commit 635a92d35d
3 changed files with 7 additions and 1 deletions

View file

@ -2,6 +2,7 @@
* Source/NSGString.m: Removed obsolete methods and added range checks.
* Source/NSGCString.m: ditto.
* Source/NSAttributedString.m: Fix fencepost error in -description.
2000-09-08 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -191,7 +191,8 @@ static Class NSMutableAttributedString_concrete_class;
NSMutableString *desc;
desc = AUTORELEASE([[super description] mutableCopy]);
while (index <= length &&
[desc appendFormat: @" Length: %u", length];
while (index < length &&
(attrs = [self attributesAtIndex: index effectiveRange: &r]) != nil)
{
index = NSMaxRange(r);

View file

@ -42,6 +42,7 @@ NSString *NSBackgroundColorAttributeName = @"NSBackgroundColor";
void printAttrString(NSAttributedString *attrStr)
{
#if 0
NSDictionary *tmpAttrDict;
NSEnumerator *keyEnumerator;
NSString *tmpStr;
@ -63,6 +64,9 @@ void printAttrString(NSAttributedString *attrStr)
(long)effectiveRange.location,
(long)effectiveRange.length);
}
#else
printf("%s\n", [[attrStr description] cString]);
#endif
}
void testAttributedString(void)