Dan Hipschman : libs/wine: Avoid over-allocating memory in default_dbgstr_wn.
Alexandre Julliard
julliard at winehq.org
Wed Jul 16 13:32:56 CDT 2008
Module: wine
Branch: master
Commit: 1b392bfa069eb43f0d6a65a4d623c95b6f624d85
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1b392bfa069eb43f0d6a65a4d623c95b6f624d85
Author: Dan Hipschman <dsh at linux.ucla.edu>
Date: Tue Jul 15 15:55:36 2008 -0700
libs/wine: Avoid over-allocating memory in default_dbgstr_wn.
---
libs/wine/debug.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libs/wine/debug.c b/libs/wine/debug.c
index 67cc172..12dbeb8 100644
--- a/libs/wine/debug.c
+++ b/libs/wine/debug.c
@@ -339,7 +339,7 @@ static const char *default_dbgstr_wn( const WCHAR *str, int n )
}
if (n < 0) n = 0;
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++ = '"';
while (n-- > 0 && dst <= res + size - 10)
More information about the wine-cvs
mailing list