libs/wine: Avoid over-allocating memory in default_dbgstr_wn.

This commit is contained in:
Dan Hipschman 2008-07-15 15:55:36 -07:00 committed by Alexandre Julliard
parent 8af1dba5a9
commit 1b392bfa06
1 changed files with 1 additions and 1 deletions

View File

@ -339,7 +339,7 @@ static const char *default_dbgstr_wn( const WCHAR *str, int n )
} }
if (n < 0) n = 0; if (n < 0) n = 0;
size = 12 + min( 300, n * 5 ); size = 12 + min( 300, n * 5 );
dst = res = funcs.get_temp_buffer( n * 5 + 7 ); dst = res = funcs.get_temp_buffer( size );
*dst++ = 'L'; *dst++ = 'L';
*dst++ = '"'; *dst++ = '"';
while (n-- > 0 && dst <= res + size - 10) while (n-- > 0 && dst <= res + size - 10)