Fixed potential crashes when reading previous report.

This commit is contained in:
WrinklyNinja
2013-09-13 18:10:42 +01:00
parent c015780c38
commit 427e405be2
+8 -4
View File
@@ -749,11 +749,15 @@ void Launcher::OnSortPlugins(wxCommandEvent& event) {
//Slim down to only the details section.
size_t pos1 = oldDetails.find("<div id=\"plugins\"");
pos1 = oldDetails.find("<ul>", pos1);
size_t pos2 = oldDetails.find("</div>", pos1);
pos2 = oldDetails.rfind("</ul>", pos2) - 3; //Remove the 3 tabs preceding the closing tag.
if (pos1 != string::npos) {
pos1 = oldDetails.find("<ul>", pos1);
if (pos1 != string::npos) {
size_t pos2 = oldDetails.find("</div>", pos1);
pos2 = oldDetails.rfind("</ul>", pos2) - 3; //Remove the 3 tabs preceding the closing tag.
oldDetails = oldDetails.substr(pos1, pos2 - pos1);
oldDetails = oldDetails.substr(pos1, pos2 - pos1);
}
}
boost::replace_all(oldDetails, "\t\t\t\t", "\t");
oldDetails += "</ul>\n";
}