diff options
author | Andrew Kaster <akaster@serenityos.org> | 2023-02-25 14:27:46 -0700 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-25 22:31:17 +0100 |
commit | 72a48ee1eeb9fc7b9a874fb32a7ff7fd3a61877a (patch) | |
tree | 2b4cc77d3404579c422e1bf82d469aceb40ee1bb /Userland/Libraries/LibCore/Group.cpp | |
parent | 19ca8d7fb7ccc02889684e85c9d90d472166bdee (diff) | |
download | serenity-72a48ee1eeb9fc7b9a874fb32a7ff7fd3a61877a.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibCore/Group.cpp')
-rw-r--r-- | Userland/Libraries/LibCore/Group.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCore/Group.cpp b/Userland/Libraries/LibCore/Group.cpp index bf99278b1b..3baa651164 100644 --- a/Userland/Libraries/LibCore/Group.cpp +++ b/Userland/Libraries/LibCore/Group.cpp @@ -74,7 +74,7 @@ ErrorOr<void> Group::add_group(Group& group) return Error::from_string_literal("Group name can not be empty."); // A quick sanity check on group name - if (strpbrk(group.name().characters(), "\\/!@#$%^&*()~+=`:\n")) + if (group.name().find_any_of("\\/!@#$%^&*()~+=`:\n"sv, DeprecatedString::SearchDirection::Forward).has_value()) return Error::from_string_literal("Group name has invalid characters."); // Disallow names starting with '_', '-' or other non-alpha characters. |