diff options
Diffstat (limited to 'minion/src/util.cpp')
-rw-r--r-- | minion/src/util.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/minion/src/util.cpp b/minion/src/util.cpp index f587781..540a20c 100644 --- a/minion/src/util.cpp +++ b/minion/src/util.cpp @@ -3,7 +3,7 @@ namespace util { -bool str_ends_with(const char *str, const char *other_str) noexcept +auto str_ends_with(const char *str, const char *other_str) noexcept -> bool { if (str == nullptr || other_str == nullptr) { @@ -25,11 +25,16 @@ void substr(const char *str, const char *end, char *dest) noexcept { auto *dest_head = dest; - for (const char *char_ptr = str; char_ptr + 1 != end; ++char_ptr) + for (const char *char_ptr = str; char_ptr != end; ++char_ptr) { *dest_head = *char_ptr; dest_head++; } } +auto streq(const char *str_one, const char *str_two) noexcept -> bool +{ + return strcmp(str_one, str_two) == 0; +} + } // namespace util |