mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 17:58:37 +12: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 <fstream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
#include <charconv>
|
||||||
|
|
||||||
#include "Utilities/JIT.h"
|
#include "Utilities/JIT.h"
|
||||||
|
|
||||||
|
@ -537,16 +538,8 @@ const bool Emulator::SetUsr(const std::string& user)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 id;
|
u32 id = 0;
|
||||||
|
std::from_chars(&user.front(), &user.back() + 1, id);
|
||||||
try
|
|
||||||
{
|
|
||||||
id = static_cast<u32>(std::stoul(user));
|
|
||||||
}
|
|
||||||
catch (const std::exception&)
|
|
||||||
{
|
|
||||||
id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id == 0)
|
if (id == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue