]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: t_split_key_value*() - Use ATTR_NOWARN_UNUSED_RESULT
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 7 Feb 2023 18:43:08 +0000 (20:43 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 7 Feb 2023 18:44:29 +0000 (20:44 +0200)
src/lib/strfuncs.h

index 160501323461226e6849137b6a1f80933c1f6ac3..7111e9ee150cea507b940836bdb879f5b8be54c5 100644 (file)
@@ -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);
 }