From 250b1b890293bce75747ed2f12e18c1b2e6cfd83 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Tue, 3 Feb 2015 23:39:47 +0000 Subject: [PATCH] Small fix for the "memory write -i filename" command -- if the user fails to specify the number of bytes to write into the inferior process, the "default byte size" will be 1. In that case, we want to copy the entire file into memory. The code was looking for a default byte size of 0 to indicate that the user had not provided a specific # of bytes to copy; adjust that to 1 to match the actual default value. llvm-svn: 228067 --- lldb/source/Commands/CommandObjectMemory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index ed650a1..dac6dd8 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -1447,7 +1447,7 @@ protected: if (m_memory_options.m_infile) { size_t length = SIZE_MAX; - if (item_byte_size > 0) + if (item_byte_size > 1) length = item_byte_size; lldb::DataBufferSP data_sp (m_memory_options.m_infile.ReadFileContents (m_memory_options.m_infile_offset, length)); if (data_sp) -- 2.7.4