Try not to display uninitialized data in traces (found by Valgrind).
authorFrancois Gouget <fgouget@codeweavers.com>
Sat, 13 Dec 2003 01:34:40 +0000 (01:34 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Sat, 13 Dec 2003 01:34:40 +0000 (01:34 +0000)
dlls/advapi32/registry.c
dlls/ntdll/resource.c

index 0d806788557d45d179c93903c0703fcf5b4b3fca..016c1094698403cdbafb7176a2c6f08c567c176a 100644 (file)
@@ -1013,7 +1013,8 @@ DWORD WINAPI RegQueryValueExW( HKEY hkey, LPCWSTR name, LPDWORD reserved, LPDWOR
     static const int info_size = offsetof( KEY_VALUE_PARTIAL_INFORMATION, Data );
 
     TRACE("(%p,%s,%p,%p,%p,%p=%ld)\n",
-          hkey, debugstr_w(name), reserved, type, data, count, count ? *count : 0 );
+          hkey, debugstr_w(name), reserved, type, data, count,
+          (count && data) ? *count : 0 );
 
     if ((data && !count) || reserved) return ERROR_INVALID_PARAMETER;
     if (!(hkey = get_special_root_hkey( hkey ))) return ERROR_INVALID_HANDLE;
index f484be17fae8c6c8f1471c67fc89f6bee8e60fdd..9458b35b25c84d6056a9e560cfc4a2ca556c11d5 100644 (file)
@@ -275,7 +275,8 @@ NTSTATUS WINAPI LdrFindResourceDirectory_U( HMODULE hmod, const LDR_RESOURCE_INF
 
     if (info) TRACE( "module %p type %s name %s lang %04lx level %ld\n",
                      hmod, debugstr_w((LPCWSTR)info->Type),
-                     debugstr_w((LPCWSTR)info->Name), info->Language, level );
+                     level > 1 ? debugstr_w((LPCWSTR)info->Name) : "",
+                     level > 2 ? info->Language : 0, level );
 
     __TRY
     {
@@ -302,7 +303,8 @@ NTSTATUS WINAPI LdrFindResource_U( HMODULE hmod, const LDR_RESOURCE_INFO *info,
 
     if (info) TRACE( "module %p type %s name %s lang %04lx level %ld\n",
                      hmod, debugstr_w((LPCWSTR)info->Type),
-                     debugstr_w((LPCWSTR)info->Name), info->Language, level );
+                     level > 1 ? debugstr_w((LPCWSTR)info->Name) : "",
+                     level > 2 ? info->Language : 0, level );
 
     __TRY
     {