mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Don't leak memory when handling %s, %S, %@ with strings longer than 8191 characters.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16931 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6341c223a6
commit
ad9e0c2bf3
2 changed files with 21 additions and 14 deletions
|
@ -1787,14 +1787,15 @@ NSDictionary *locale)
|
|||
if ((width -= len) <= 0)
|
||||
{
|
||||
outstring (string, len);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!left)
|
||||
PAD (' ');
|
||||
outstring (string, len);
|
||||
if (left)
|
||||
PAD (' ');
|
||||
else
|
||||
{
|
||||
if (!left)
|
||||
PAD (' ');
|
||||
outstring (string, len);
|
||||
if (left)
|
||||
PAD (' ');
|
||||
}
|
||||
if (string_malloced)
|
||||
NSZoneFree(s->z, string);
|
||||
}
|
||||
|
@ -1842,14 +1843,15 @@ NSDictionary *locale)
|
|||
if ((width -= len) < 0)
|
||||
{
|
||||
outstring (string, len);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!left)
|
||||
PAD (' ');
|
||||
outstring (string, len);
|
||||
if (left)
|
||||
PAD (' ');
|
||||
else
|
||||
{
|
||||
if (!left)
|
||||
PAD (' ');
|
||||
outstring (string, len);
|
||||
if (left)
|
||||
PAD (' ');
|
||||
}
|
||||
if (string_malloced)
|
||||
NSZoneFree(s->z, string);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue