From 598ffa03b4191a6b51374c8ee2528f2d1dadbb62 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Sun, 29 Aug 2021 20:42:32 -0400 Subject: bugfix - oob in SettingsErrors::ToString --- wrapper/wrapper.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'wrapper/wrapper.cpp') diff --git a/wrapper/wrapper.cpp b/wrapper/wrapper.cpp index 6344b77..4e6c4f1 100644 --- a/wrapper/wrapper.cpp +++ b/wrapper/wrapper.cpp @@ -462,8 +462,8 @@ public ref class SettingsErrors public: List^ list; - int countX; - int countY; + int lastX; + int lastY; delegate void MsgHandler(const char*); @@ -486,9 +486,9 @@ public: Marshal::StructureToPtr(settings, (IntPtr)args_ptr, false); list = gcnew List(); - auto [cx, cy, _] = ra::valid(*args_ptr, fp); - countX = cx; - countY = cy; + auto [last_x, last_y, _] = ra::valid(*args_ptr, fp); + lastX = last_x; + lastY = last_y; gch.Free(); delete args_ptr; @@ -503,15 +503,15 @@ public: { Text::StringBuilder^ sb = gcnew Text::StringBuilder(); - for each (auto s in list->GetRange(0, countX)) + for each (auto s in list->GetRange(0, lastX)) { sb->AppendFormat("x: {0}\n", s); } - for each (auto s in list->GetRange(countX, countY)) + for each (auto s in list->GetRange(lastX, lastY - lastX)) { sb->AppendFormat("y: {0}\n", s); } - for each (auto s in list->GetRange(countY, list->Count)) + for each (auto s in list->GetRange(lastY, list->Count - lastY)) { sb->AppendLine(s); } -- cgit v1.2.3