Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
All the cool kids hard code string lengths.
Fixes issue 6090.
  • Loading branch information
RachelBryk committed Mar 13, 2013
1 parent e73cc85 commit 0b34457
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Source/Core/DolphinWX/Src/ISOProperties.cpp
Expand Up @@ -659,8 +659,8 @@ void CISOProperties::OnExtractFile(wxCommandEvent& WXUNUSED (event))

if (DiscIO::IsVolumeWiiDisc(OpenISO))
{
int partitionNum = wxAtoi(File.SubString(10, 11));
File.Remove(0, 12); // Remove "Partition x/"
int partitionNum = wxAtoi(File.Mid(File.find_first_of("/"), 1));
File.Remove(0, File.find_first_of("/") +1); // Remove "Partition x/"
WiiDisc.at(partitionNum).FileSystem->ExportFile(WxStrToStr(File).c_str(), WxStrToStr(Path).c_str());
}
else
Expand Down Expand Up @@ -794,8 +794,8 @@ void CISOProperties::OnExtractDir(wxCommandEvent& event)

if (DiscIO::IsVolumeWiiDisc(OpenISO))
{
int partitionNum = wxAtoi(Directory.SubString(10, 11));
Directory.Remove(0, 12); // Remove "Partition x/"
int partitionNum = wxAtoi(Directory.Mid(Directory.find_first_of("/"), 1));
Directory.Remove(0, Directory.find_first_of("/") +1); // Remove "Partition x/"
ExportDir(WxStrToStr(Directory).c_str(), WxStrToStr(Path).c_str(), partitionNum);
}
else
Expand Down Expand Up @@ -860,7 +860,7 @@ void CISOProperties::CheckPartitionIntegrity(wxCommandEvent& event)
return;

// Get the partition number from the item text ("Partition N")
int PartitionNum = wxAtoi(PartitionName.SubString(10, 11));
int PartitionNum = wxAtoi(PartitionName.Mid(PartitionName.find_first_of("0123456789"), 1));
const WiiPartition& Partition = WiiDisc[PartitionNum];

wxProgressDialog* dialog = new wxProgressDialog(
Expand Down

0 comments on commit 0b34457

Please sign in to comment.