mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix range error
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14373 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
525997170d
commit
ce665a643a
1 changed files with 9 additions and 4 deletions
|
@ -3009,8 +3009,11 @@ handle_printf_atsign (FILE *stream,
|
|||
length = newLength - length; // What we want to add.
|
||||
if (length <= (padLength - padIndex))
|
||||
{
|
||||
NSRange r;
|
||||
|
||||
r = NSMakeRange(padIndex, length);
|
||||
return [self stringByAppendingString:
|
||||
[padString substringWithRange: NSMakeRange(padIndex, length)]];
|
||||
[padString substringWithRange: r]];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3018,9 +3021,11 @@ handle_printf_atsign (FILE *stream,
|
|||
|
||||
if (padIndex > 0)
|
||||
{
|
||||
[m appendString:
|
||||
[padString substringWithRange: NSMakeRange(padIndex, length)]];
|
||||
length -= (padLength - padIndex);
|
||||
NSRange r;
|
||||
|
||||
r = NSMakeRange(padIndex, padLength - padIndex);
|
||||
[m appendString: [padString substringWithRange: r]];
|
||||
length -= r.length;
|
||||
}
|
||||
/*
|
||||
* In case we have to append a small string lots of times,
|
||||
|
|
Loading…
Reference in a new issue