mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:17:46 +00:00
HexEditor: Fixed off-by-one copying bug
When copying as hex or text we missed the last byte.
This commit is contained in:
parent
5cc722cec4
commit
443eda986a
1 changed files with 2 additions and 2 deletions
|
@ -93,7 +93,7 @@ bool HexEditor::copy_selected_hex_to_clipboard()
|
|||
return false;
|
||||
|
||||
StringBuilder output_string_builder;
|
||||
for (int i = m_selection_start; i < m_selection_end; i++) {
|
||||
for (int i = m_selection_start; i <= m_selection_end; i++) {
|
||||
output_string_builder.appendf("%02X ", m_buffer.data()[i]);
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ bool HexEditor::copy_selected_text_to_clipboard()
|
|||
return false;
|
||||
|
||||
StringBuilder output_string_builder;
|
||||
for (int i = m_selection_start; i < m_selection_end; i++) {
|
||||
for (int i = m_selection_start; i <= m_selection_end; i++) {
|
||||
output_string_builder.appendf("%c", isprint(m_buffer.data()[i]) ? m_buffer[i] : '.');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue