make line_i a size_t in memory_editor to avoid overflow

This commit is contained in:
silverweed 2024-07-11 16:32:12 +02:00
parent af8606c44a
commit e66ecfe8a7

View file

@ -276,7 +276,7 @@ struct MemoryEditor
const char* format_byte_space = OptUpperCaseHex ? "%02X " : "%02x ";
while (clipper.Step())
for (int line_i = clipper.DisplayStart; line_i < clipper.DisplayEnd; line_i++) // display only visible lines
for (size_t line_i = clipper.DisplayStart; line_i < clipper.DisplayEnd; line_i++) // display only visible lines
{
size_t addr = (size_t)(line_i * Cols);
ImGui::Text(format_address, s.AddrDigitsCount, base_display_addr + addr);