mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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
d29f9f48b3
commit
064a6bd9b8
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.
|
length = newLength - length; // What we want to add.
|
||||||
if (length <= (padLength - padIndex))
|
if (length <= (padLength - padIndex))
|
||||||
{
|
{
|
||||||
|
NSRange r;
|
||||||
|
|
||||||
|
r = NSMakeRange(padIndex, length);
|
||||||
return [self stringByAppendingString:
|
return [self stringByAppendingString:
|
||||||
[padString substringWithRange: NSMakeRange(padIndex, length)]];
|
[padString substringWithRange: r]];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3018,9 +3021,11 @@ handle_printf_atsign (FILE *stream,
|
||||||
|
|
||||||
if (padIndex > 0)
|
if (padIndex > 0)
|
||||||
{
|
{
|
||||||
[m appendString:
|
NSRange r;
|
||||||
[padString substringWithRange: NSMakeRange(padIndex, length)]];
|
|
||||||
length -= (padLength - padIndex);
|
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,
|
* In case we have to append a small string lots of times,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue