aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Core/SourceManager.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-06-13 19:31:46 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-06-13 19:37:19 +0000
commite8d8bef961a50d4dc22501cde4fb9fb0be1b2532 (patch)
tree94f04805f47bb7c59ae29690d8952b6074fff602 /contrib/llvm-project/lldb/source/Core/SourceManager.cpp
parentbb130ff39747b94592cb26d71b7cb097b9a4ea6b (diff)
parentb60736ec1405bb0a8dd40989f67ef4c93da068ab (diff)
Diffstat (limited to 'contrib/llvm-project/lldb/source/Core/SourceManager.cpp')
-rw-r--r--contrib/llvm-project/lldb/source/Core/SourceManager.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/llvm-project/lldb/source/Core/SourceManager.cpp b/contrib/llvm-project/lldb/source/Core/SourceManager.cpp
index 7414dd281d43..e79fcb48742d 100644
--- a/contrib/llvm-project/lldb/source/Core/SourceManager.cpp
+++ b/contrib/llvm-project/lldb/source/Core/SourceManager.cpp
@@ -183,14 +183,14 @@ size_t SourceManager::DisplaySourceLinesWithLineNumbersUsingLastFile(
break;
}
- char prefix[32] = "";
+ std::string prefix;
if (bp_locs) {
uint32_t bp_count = bp_locs->NumLineEntriesWithLine(line);
if (bp_count > 0)
- ::snprintf(prefix, sizeof(prefix), "[%u] ", bp_count);
+ prefix = llvm::formatv("[{0}]", bp_count);
else
- ::snprintf(prefix, sizeof(prefix), " ");
+ prefix = " ";
}
char buffer[3];
@@ -206,7 +206,8 @@ size_t SourceManager::DisplaySourceLinesWithLineNumbersUsingLastFile(
.str());
}
- s->Printf("%s%s %-4u\t", prefix, current_line_highlight.c_str(), line);
+ s->Printf("%s%s %-4u\t", prefix.c_str(), current_line_highlight.c_str(),
+ line);
// So far we treated column 0 as a special 'no column value', but
// DisplaySourceLines starts counting columns from 0 (and no column is