Skip to content

Commit

Permalink
Clarify confusing GUID-length message
Browse files Browse the repository at this point in the history
The GUID parameter to RetrieveSymbols must be exactly 32 characters in
length but when it isn't the tool wouldn't tell you what the length was.
It would also print some confusing information about trimmed GUIDs
which was not always relevant.

Now it prints the size and only prints the trimming information when it
is relevant (and more clearly).
  • Loading branch information
randomascii committed Oct 23, 2020
1 parent 2e5ce32 commit 25f1764
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions RetrieveSymbols/RetrieveSymbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,13 @@ int main(int argc, _Pre_readable_size_(argc) char* argv[])
}
if (gText.size() != 32)
{
printf("Error: PDB GUIDs must be exactly 32 characters"
" (%s was stripped to %s).\n", gTextArg.c_str(), gText.c_str());
return 10;
if (gText == gTextArg)
printf("Error: PDB GUIDs must be exactly 32 characters, length of %s is %zu.",
gText.c_str(), gText.size());
else
printf("Error: PDB GUIDs must be exactly 32 characters, length of %s (stripped from %s) is %zu.",
gText.c_str(), gTextArg.c_str(), gText.size());
return 10;
}

int count = sscanf_s(gText.substr(0, 8).c_str(), "%x", &g.Data1);
Expand Down

0 comments on commit 25f1764

Please sign in to comment.