Replace confusing buffer calls in vssprintf
This is basically just resizing the buffer ahead of the vsnprintf, no need for the extra Release/GetBuffer indirection.
This commit is contained in:
+2
-2
@@ -405,8 +405,8 @@ RString vssprintf( const char *szFormat, va_list argList )
|
|||||||
va_end(tmp);
|
va_end(tmp);
|
||||||
|
|
||||||
RString sRet;
|
RString sRet;
|
||||||
std::vsnprintf( sRet.GetBuffer(iNeeded), iNeeded+1, szFormat, argList );
|
sRet.resize(iNeeded);
|
||||||
sRet.ReleaseBuffer( iNeeded );
|
std::vsnprintf( &sRet.front(), iNeeded+1, szFormat, argList );
|
||||||
return sRet;
|
return sRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user