Patch #2892 2009-12-30 21:28

techy

Array index out of range (debug19)
Download
2892-Array_index_ou.patch (572 bytes)
Category
Application::Bugfix
Status
Accepted
Close date
2009-12-31 17:11
Assigned to
mortenmacfly
Index: src/sdk/projectoptionsdlg.cpp
===================================================================
--- src/sdk/projectoptionsdlg.cpp    (revision 5987)
+++ src/sdk/projectoptionsdlg.cpp    (working copy)
@@ -884,7 +884,7 @@
         fname.Assign(paths[i]);
         fname.MakeRelativeTo(m_Project->GetBasePath());
         ctrl->Append(fname.GetFullPath());
-        ctrl->SetSelection(ctrl->GetCount());
+        ctrl->SetSelection(ctrl->GetCount()-1);
 
         wxTreeCtrl* tc = XRCCTRL(*this, "tcOverview", wxTreeCtrl);
         wxTreeItemId sel = tc->GetSelection();
techy 2009-12-30 21:29

If nothing else, range checks in debug mode are very useful...