mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00:00
Use std::from_chars in Emulator::SetUsr
This commit is contained in:
parent
218758183d
commit
81c61e230f
1 changed files with 3 additions and 10 deletions
|
@ -37,6 +37,7 @@
|
|||
#include <fstream>
|
||||
#include <memory>
|
||||
#include <regex>
|
||||
#include <charconv>
|
||||
|
||||
#include "Utilities/JIT.h"
|
||||
|
||||
|
@ -537,16 +538,8 @@ const bool Emulator::SetUsr(const std::string& user)
|
|||
return false;
|
||||
}
|
||||
|
||||
u32 id;
|
||||
|
||||
try
|
||||
{
|
||||
id = static_cast<u32>(std::stoul(user));
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
id = 0;
|
||||
}
|
||||
u32 id = 0;
|
||||
std::from_chars(&user.front(), &user.back() + 1, id);
|
||||
|
||||
if (id == 0)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue