From e98ce710b8ac84c8578099018bbbc07886d2b150 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 16 Aug 2019 14:48:54 +0200 Subject: [PATCH] util/WStringAPI: add wcsncmp() wrapper --- src/util/WStringAPI.hxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/util/WStringAPI.hxx b/src/util/WStringAPI.hxx index 1cbf5dcd5..58bc24c87 100644 --- a/src/util/WStringAPI.hxx +++ b/src/util/WStringAPI.hxx @@ -126,6 +126,13 @@ StringCompare(const wchar_t *a, const wchar_t *b) noexcept return wcscmp(a, b); } +gcc_pure gcc_nonnull_all +static inline int +StringCompare(const wchar_t *a, const wchar_t *b, size_t n) noexcept +{ + return wcsncmp(a, b, n); +} + /** * Checks whether str1 and str2 are equal. * @param str1 String 1