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

Dan Hipschman dsh at linux.ucla.edu
Tue Jul 15 17:55:36 CDT 2008


---
 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-patches mailing list