mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-23 19:25:35 +08:00
Modified Sanitize
Modified Sanitize to allow all ANSI printable chars.
This commit is contained in:
parent
32b8a8b169
commit
6d22c4989e
@ -23,11 +23,10 @@ std::string Settings::sanitize(std::string name)
|
|||||||
name.erase(std::remove(name.begin(), name.end(), '\n'), name.end());
|
name.erase(std::remove(name.begin(), name.end(), '\n'), name.end());
|
||||||
name.erase(std::remove(name.begin(), name.end(), '\r'), name.end());
|
name.erase(std::remove(name.begin(), name.end(), '\r'), name.end());
|
||||||
|
|
||||||
for (int i = 0; i < name.size(); ++i) {
|
for (auto& i : name)
|
||||||
if (name[i] >= 'a' && name[i] <= 'z') continue;
|
{
|
||||||
if (name[i] >= 'A' && name[i] <= 'Z') continue;
|
if (!isprint(i))
|
||||||
if (name[i] >= '0' && name[i] <= '9') continue;
|
i = ' ';
|
||||||
name[i] = ' ';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
Loading…
Reference in New Issue
Block a user