Skip to content

Commit 0515c6d

Browse files
committed
fix GetSBFileSpecPath extra char
1 parent 2e9edca commit 0515c6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lldb/tools/lldb-dap/LLDBUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ std::string GetSBFileSpecPath(const lldb::SBFileSpec &file_spec) {
247247
const auto directory_length = ::strlen(file_spec.GetDirectory());
248248
const auto file_name_length = ::strlen(file_spec.GetFilename());
249249

250-
std::string path(directory_length + file_name_length + 2, '\0');
251-
file_spec.GetPath(path.data(), path.length());
250+
std::string path(directory_length + file_name_length + 1, '\0');
251+
file_spec.GetPath(path.data(), path.length() + 1);
252252
return path;
253253
}
254254

0 commit comments

Comments
 (0)