[PATCH] oleaut32: Fix a trace containing a null character.

Francois Gouget fgouget at codeweavers.com
Wed Jul 7 12:13:53 CDT 2021


printf("%c Hello\n", 0) works but not TRACE("%c Hello\n", 0) because the
string is formatted before printing.
Work around the issue with wine_dbgstr_w().

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
As an alternative, maybe this issue could be avoided by passing the 
string size to __wine_dbg_output().
---
 dlls/oleaut32/variant.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c
index ace33a006f4..129e13da17d 100644
--- a/dlls/oleaut32/variant.c
+++ b/dlls/oleaut32/variant.c
@@ -1554,8 +1554,8 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID
             break;
     default: WARN("buffer too small for LOCALE_SCURRENCY\n");
   }
-  TRACE("lcid 0x%x, cCurrencyLocal =%d,%d '%c','%c'\n", lcid, lpChars->cCurrencyLocal,
-        lpChars->cCurrencyLocal2, lpChars->cCurrencyLocal, lpChars->cCurrencyLocal2);
+  TRACE("lcid 0x%x, cCurrencyLocal=%d,%d %s\n", lcid, lpChars->cCurrencyLocal,
+        lpChars->cCurrencyLocal2, wine_dbgstr_w(buff));
 
   memcpy(&lastChars, lpChars, sizeof(defaultChars));
   lastLcid = lcid;
-- 
2.20.1



More information about the wine-devel mailing list