summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/File.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Host/common/File.cpp')
-rw-r--r--lldb/source/Host/common/File.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp
index a84266f7110..ca0c223e629 100644
--- a/lldb/source/Host/common/File.cpp
+++ b/lldb/source/Host/common/File.cpp
@@ -538,7 +538,7 @@ File::Read (void *buf, size_t &num_bytes, off_t &offset)
}
Error
-File::Read (size_t &num_bytes, off_t &offset, DataBufferSP &data_buffer_sp)
+File::Read (size_t &num_bytes, off_t &offset, bool null_terminate, DataBufferSP &data_buffer_sp)
{
Error error;
@@ -557,7 +557,7 @@ File::Read (size_t &num_bytes, off_t &offset, DataBufferSP &data_buffer_sp)
num_bytes = bytes_left;
std::auto_ptr<DataBufferHeap> data_heap_ap;
- data_heap_ap.reset(new DataBufferHeap(num_bytes, '\0'));
+ data_heap_ap.reset(new DataBufferHeap(num_bytes + (null_terminate ? 1 : 0), '\0'));
if (data_heap_ap.get())
{
OpenPOWER on IntegriCloud