Commit 5ac749e2 authored by Nico Weber's avatar Nico Weber

win: Don't use precision with %wZ, it's ignored.

Found by clang, which says:

..\..\sandbox\win\sandbox_poc\pocdll\handles.cc(156,34) :  warning(clang): precision used with 'Z' conversion specifier, resulting in undefined behavior [-Wformat]
                      "Type: %-13.13wZ Path: %wZ\r\n",
                             ~~~~^~~~~

"undefined behavior" is a bit too strong language for a vendor-defined type,
but http://msdn.microsoft.com/en-us/library/0ecbz014.aspx doesn't document
what precision does for %Z, and in practice it seems to be ignored (see
http://llvm.org/PR20876). So don't use it.

No intended behavior change.

BUG=82385
R=scottmg@chromium.org
TBR=cpu

Review URL: https://codereview.chromium.org/552663004

Cr-Commit-Position: refs/heads/master@{#293757}
parent 1e542cb0
......@@ -153,14 +153,14 @@ void POCDLL_API TestGetHandle(HANDLE log) {
file_name_string.Length = (USHORT)file_name->FileNameLength;
file_name_string.MaximumLength = (USHORT)file_name->FileNameLength;
fprintf(output, "[GRANTED] Handle 0x%4.4X Access: 0x%8.8lX "
"Type: %-13.13wZ Path: %wZ\r\n",
"Type: %-13wZ Path: %wZ\r\n",
h,
system_handles->Information[i].GrantedAccess,
type ? &type->TypeName : NULL,
&file_name_string);
} else {
fprintf(output, "[GRANTED] Handle 0x%4.4X Access: 0x%8.8lX "
"Type: %-13.13wZ Path: %wZ\r\n",
"Type: %-13wZ Path: %wZ\r\n",
h,
system_handles->Information[i].GrantedAccess,
type ? &type->TypeName : NULL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment