1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:54:58 +00:00

LibCore+Utilities: Replace uses of strpbrk with find_any_of()

We don't need to use scary C string POSIX APIs when we have nicer ones
on String/DeprecatedString.
This commit is contained in:
Andrew Kaster 2023-02-25 14:27:46 -07:00 committed by Linus Groh
parent 19ca8d7fb7
commit 72a48ee1ee
2 changed files with 2 additions and 2 deletions

View file

@ -53,7 +53,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.parse(arguments);
// Let's run a quick sanity check on username
if (strpbrk(username.characters(), "\\/!@#$%^&*()~+=`:\n")) {
if (username.find_any_of("\\/!@#$%^&*()~+=`:\n"sv, DeprecatedString::SearchDirection::Forward).has_value()) {
warnln("invalid character in username, {}", username);
return 1;
}