From 9c547d5eefbc097a0a713e83c6c6528eff06e2cf Mon Sep 17 00:00:00 2001 From: Learath2 Date: Sat, 15 Jul 2017 02:38:10 +0200 Subject: [PATCH] Fix bug with std::stof being locale-dependant (#3012) --- rpcs3/rpcs3qt/main_window.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 79d05bb79e..89bbea7774 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -1,4 +1,4 @@ - + #include #include #include @@ -447,11 +447,10 @@ void main_window::InstallPup() std::string version_string = pup.get_file(0x100).to_string(); version_string.erase(version_string.find('\n')); - const float cur_version = 4.81f; - float version = std::stof(version_string); + const std::string cur_version = "4.81"; - if (version < 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)), + 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(QString::fromStdString(cur_version), QString::fromStdString(version_string)), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No) { return;