mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-12-24 09:24:15 +08:00
Merge branch 'issue_#8' into 'master'
Issue #8 Modified Sanitize See merge request Mr_Goldberg/goldberg_emulator!11
This commit is contained in:
commit
0543229b3e
@ -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(), '\r'), name.end());
|
||||
|
||||
for (int i = 0; i < name.size(); ++i) {
|
||||
if (name[i] >= 'a' && name[i] <= 'z') continue;
|
||||
if (name[i] >= 'A' && name[i] <= 'Z') continue;
|
||||
if (name[i] >= '0' && name[i] <= '9') continue;
|
||||
name[i] = ' ';
|
||||
for (auto& i : name)
|
||||
{
|
||||
if (!isprint(i))
|
||||
i = ' ';
|
||||
}
|
||||
|
||||
return name;
|
||||
|
Loading…
x
Reference in New Issue
Block a user