([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:
mccallum 1996-10-31 18:26:39 +00:00
parent 5c4c7379ea
commit f4e558af65

View file

@ -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 */