If two threads call vssprintf at the same time, it is possible for bInitialized to be set before actually setting bExactSizeSupported. Set bInitialized after setting bExactSizeSupported to avoid this.
This commit is contained in:
@@ -318,9 +318,9 @@ RString vssprintf( const char *szFormat, va_list argList )
|
||||
/* Some systems return the actual size required when snprintf
|
||||
* doesn't have enough space. This lets us avoid wasting time
|
||||
* iterating, and wasting memory. */
|
||||
bInitialized = true;
|
||||
char ignore;
|
||||
bExactSizeSupported = ( snprintf( &ignore, 0, "Hello World" ) == 11 );
|
||||
bInitialized = true;
|
||||
}
|
||||
|
||||
if( bExactSizeSupported )
|
||||
|
||||
Reference in New Issue
Block a user