mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00:00
Fix lv2_obj::name64 regression
This commit is contained in:
parent
5bc4f9df0d
commit
aa4fdff82c
1 changed files with 5 additions and 2 deletions
|
@ -77,10 +77,13 @@ private:
|
|||
|
||||
public:
|
||||
|
||||
static std::string name64(const u64& name_u64)
|
||||
static std::string name64(u64 name_u64)
|
||||
{
|
||||
std::string str{reinterpret_cast<const char*>(&name_u64), 7};
|
||||
const auto ptr = reinterpret_cast<const char*>(&name_u64);
|
||||
|
||||
// NTS string, ignore invalid/newline characters
|
||||
// Example: "lv2\n\0tx" will be printed as "lv2"
|
||||
std::string str{ptr, std::find(ptr, ptr + 7, '\0')};
|
||||
str.erase(std::remove_if(str.begin(), str.end(), [](uchar c){ return !std::isprint(c); }), str.end());
|
||||
|
||||
return str;
|
||||
|
|
Loading…
Add table
Reference in a new issue