diff options
author | Adrian Thurston <thurston@complang.org> | 2009-12-30 14:43:28 +0000 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2009-12-30 14:43:28 +0000 |
commit | d3aa6e3c201366d18496f2879cfd3c4f64d0c973 (patch) | |
tree | 25f7fadefede7cd5838e051eaef0f69a79aae03b /aapl | |
parent | b2141b021530386b8c6a8a6951f84965dd5cc2d4 (diff) | |
download | colm-d3aa6e3c201366d18496f2879cfd3c4f64d0c973.tar.gz |
Need a va_start and va_end around each vsnprintf.
Diffstat (limited to 'aapl')
-rw-r--r-- | aapl/astring.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/aapl/astring.h b/aapl/astring.h index 59343726..a5b038af 100644 --- a/aapl/astring.h +++ b/aapl/astring.h @@ -444,10 +444,15 @@ template<class T> StrTmpl<T>::StrTmpl( long lenGuess, const char *format, ... ) /* Write to the temporary buffer. */ va_start( args, format ); + va_start( args, format ); long written = vsnprintf( data, lenGuess+1, format, args ); + va_end( args ); + if ( written > lenGuess ) { setSpace( written ); + va_start( args, format ); written = vsnprintf( data, written+1, format, args ); + va_end( args ); } chop( written ); |