Fix bug with std::stof being locale-dependant (#3012)

This commit is contained in:
Learath2 2017-07-15 02:38:10 +02:00 committed by Ivan
parent 504fa5ffda
commit 9c547d5eef
1 changed files with 4 additions and 5 deletions

View File

@ -1,4 +1,4 @@

#include <QApplication> #include <QApplication>
#include <QMenuBar> #include <QMenuBar>
#include <QMessageBox> #include <QMessageBox>
@ -447,11 +447,10 @@ void main_window::InstallPup()
std::string version_string = pup.get_file(0x100).to_string(); std::string version_string = pup.get_file(0x100).to_string();
version_string.erase(version_string.find('\n')); version_string.erase(version_string.find('\n'));
const float cur_version = 4.81f; const std::string cur_version = "4.81";
float version = std::stof(version_string);
if (version < cur_version && if (version_string < cur_version &&
QMessageBox::question(this, tr("RPCS3 Firmware Installer"), tr("Old firmware detected.\nThe newest firmware version is %1 and you are trying to install version %2\nContinue installation?").arg(cur_version).arg(QString::fromStdString(version_string)), QMessageBox::question(this, tr("RPCS3 Firmware Installer"), tr("Old firmware detected.\nThe newest firmware version is %1 and you are trying to install version %2\nContinue installation?").arg(QString::fromStdString(cur_version), QString::fromStdString(version_string)),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No) QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No)
{ {
return; return;