mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Fix appending nul string
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6414 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
198a414d6b
commit
cc2156d4b9
1 changed files with 13 additions and 10 deletions
|
@ -1983,23 +1983,26 @@ handle_printf_atsign (FILE *stream,
|
|||
{
|
||||
length--;
|
||||
}
|
||||
aLength = length - 1;
|
||||
while (aLength > 1)
|
||||
if (length > 0)
|
||||
{
|
||||
if (pathSepMember(buf[aLength]) == YES)
|
||||
aLength = length - 1;
|
||||
while (aLength > 1)
|
||||
{
|
||||
if (pathSepMember(buf[aLength-1]) == YES)
|
||||
if (pathSepMember(buf[aLength]) == YES)
|
||||
{
|
||||
unsigned pos;
|
||||
|
||||
for (pos = aLength+1; pos < length; pos++)
|
||||
if (pathSepMember(buf[aLength-1]) == YES)
|
||||
{
|
||||
buf[pos-1] = buf[pos];
|
||||
unsigned pos;
|
||||
|
||||
for (pos = aLength+1; pos < length; pos++)
|
||||
{
|
||||
buf[pos-1] = buf[pos];
|
||||
}
|
||||
length--;
|
||||
}
|
||||
length--;
|
||||
}
|
||||
aLength--;
|
||||
}
|
||||
aLength--;
|
||||
}
|
||||
return [NSString stringWithCharacters: buf length: length];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue