Francois Gouget : user32/tests: Use wine_dbgstr_a() instead of %.8s.

Alexandre Julliard julliard at winehq.org
Mon Aug 9 16:21:43 CDT 2021


Module: wine
Branch: master
Commit: 1b36c218216cf7cd7793be7973efa882bac8cadd
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1b36c218216cf7cd7793be7973efa882bac8cadd

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Sun Aug  8 00:46:38 2021 +0200

user32/tests: Use wine_dbgstr_a() instead of %.8s.

This should better handle NULL pointers and bad strings.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/tests/clipboard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c
index c8de860f8cc..b10ffaf4c8f 100644
--- a/dlls/user32/tests/clipboard.c
+++ b/dlls/user32/tests/clipboard.c
@@ -1927,7 +1927,7 @@ static void test_data_handles(void)
     ok( is_fixed( h ), "expected fixed mem %p\n", h );
     ok( is_moveable( text ), "expected moveable mem %p\n", text );
     ptr = GlobalLock( h );
-    ok( !strcmp( ptr, "foobar" ), "wrong data '%.8s'\n", ptr );
+    ok( ptr && !strcmp( ptr, "foobar" ), "wrong data %s\n", wine_dbgstr_a(ptr) );
     GlobalUnlock( h );
 
     r = EmptyClipboard();




More information about the wine-cvs mailing list