mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-12-24 03:48:10 +01:00
Modified Sanitize
Modified Sanitize to allow all ANSI printable chars.
This commit is contained in:
parent
32b8a8b169
commit
6d22c4989e
1 changed files with 4 additions and 5 deletions
|
@ -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…
Reference in a new issue