From 7e817370e25227a15c91126d194df3b84e12c803 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 7 Feb 2023 20:43:08 +0200 Subject: [PATCH] lib: t_split_key_value*() - Use ATTR_NOWARN_UNUSED_RESULT --- src/lib/strfuncs.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); } -- 2.47.3