From: Timo Sirainen Date: Tue, 7 Feb 2023 18:43:08 +0000 (+0200) Subject: lib: t_split_key_value*() - Use ATTR_NOWARN_UNUSED_RESULT X-Git-Tag: 2.4.0~2999 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e817370e25227a15c91126d194df3b84e12c803;p=thirdparty%2Fdovecot%2Fcore.git lib: t_split_key_value*() - Use ATTR_NOWARN_UNUSED_RESULT --- diff --git a/src/lib/strfuncs.h b/src/lib/strfuncs.h index 1605013234..7111e9ee15 100644 --- a/src/lib/strfuncs.h +++ b/src/lib/strfuncs.h @@ -152,11 +152,13 @@ static inline char *i_strchr_to_next(const char *str, char chr) } /* Split only on the first separator encountered. - Returns TRUE if the separator was found. - Returns FALSE and *value_r = "" otherwise. */ + Returns TRUE if the separator was found, FALSE and *value_r = "" otherwise. + Normally it's fine (or even useful) to treat "key" and "key=" identically, + so return value can just be ignored. */ bool t_split_key_value(const char *arg, char separator, - const char **key_r, const char **value_r); -static inline bool + const char **key_r, const char **value_r) + ATTR_NOWARN_UNUSED_RESULT; +static inline bool ATTR_NOWARN_UNUSED_RESULT t_split_key_value_eq(const char *arg, const char **key_r, const char **value_r) { return t_split_key_value(arg, '=', key_r, value_r); }