1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Use %.*s instead of %*s when formatting strings with explicit length.

llvm-svn: 338737
This commit is contained in:
Zachary Turner 2018-08-02 17:08:24 +00:00
parent a1fabd04e3
commit 5f1a862f35

View File

@ -2081,7 +2081,7 @@ void Demangler::dumpBackReferences() {
Type::outputPre(OS, *T, *this);
Type::outputPost(OS, *T, *this);
std::printf(" [%d] - %*s\n", (int)I, (int)OS.getCurrentPosition(),
std::printf(" [%d] - %.*s\n", (int)I, (int)OS.getCurrentPosition(),
OS.getBuffer());
}
std::free(OS.getBuffer());
@ -2090,7 +2090,7 @@ void Demangler::dumpBackReferences() {
std::printf("\n");
std::printf("%d name backreferences\n", (int)BackRefCount);
for (size_t I = 0; I < BackRefCount; ++I) {
std::printf(" [%d] - %*s\n", (int)I, (int)BackReferences[I].size(),
std::printf(" [%d] - %.*s\n", (int)I, (int)BackReferences[I].size(),
BackReferences[I].begin());
}
if (BackRefCount > 0)