[SDK:WINE] Fix get_temp_buffer() call in wine_dbgstr_wn()
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 10 Jan 2025 21:12:24 +0000 (22:12 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 11 Jan 2025 20:17:28 +0000 (21:17 +0100)
Addendum to commit dbc7eeb47e (PR #4303).

The argument to get_temp_buffer() should specify the length of the
string being buffered + 1 (for the NUL-terminator).
The original code wrongly interverted this with specifying the buffer
shifted by one character.

sdk/include/reactos/wine/test.h

index 872ab75..4399a6f 100644 (file)
@@ -747,7 +747,7 @@ const char *wine_dbgstr_wn( const WCHAR *str, intptr_t n )
     }
     *dst = 0;
 
-    res = get_temp_buffer(strlen(buffer + 1));
+    res = get_temp_buffer(strlen(buffer) + 1);
     strcpy(res, buffer);
     return res;
 }