From 81c61e230f3f96f4427d87833b033c949af3aac5 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Fri, 8 Nov 2019 18:58:36 +0300 Subject: [PATCH] Use std::from_chars in Emulator::SetUsr --- rpcs3/Emu/System.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index eefdf9bbbe..787e1d2f81 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include "Utilities/JIT.h" @@ -537,16 +538,8 @@ const bool Emulator::SetUsr(const std::string& user) return false; } - u32 id; - - try - { - id = static_cast(std::stoul(user)); - } - catch (const std::exception&) - { - id = 0; - } + u32 id = 0; + std::from_chars(&user.front(), &user.back() + 1, id); if (id == 0) {