mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
([String -initWithFormat:arguments:]): Use VSPRINTF_LENGTH.
([String -initWithCFormat:arguments:]): Likewise. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1898 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5c4c7379ea
commit
f4e558af65
1 changed files with 6 additions and 2 deletions
|
@ -96,14 +96,18 @@
|
|||
- initWithFormat: (id <String>)aFormatString arguments: (va_list)arg
|
||||
{
|
||||
char buf[128]; /* xxx horrible, disgusting, fix this */
|
||||
vsprintf(buf, [aFormatString cString], arg);
|
||||
int len;
|
||||
len = VSPRINTF_LENGTH (vsprintf(buf, [aFormatString cString], arg));
|
||||
assert (len < 128);
|
||||
return [self initWithCString:buf];
|
||||
}
|
||||
|
||||
- initWithCFormat: (const char*)formatCharPtr arguments: (va_list)arg
|
||||
{
|
||||
char buf[128]; /* xxx horrible, disgusting, fix this */
|
||||
vsprintf(buf, formatCharPtr, arg);
|
||||
int len;
|
||||
len = VSPRINTF_LENGTH (vsprintf(buf, formatCharPtr, arg));
|
||||
assert (len < 128);
|
||||
return [self initWithCString:buf];
|
||||
}
|
||||
#endif /* HAVE_VSPRINTF */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue