]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: uni_utf8_get_valid_data() - Add ATTR_WARN_UNUSED_RESULT
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 25 Apr 2018 12:23:35 +0000 (15:23 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Fri, 27 Apr 2018 11:19:04 +0000 (14:19 +0300)
Ignoring the return value most likely leads to buggy code, so make sure it's
checked.

src/lib/unichar.h

index f263b6fa81b0d9ec52405b9d966fea1de3ece98c..bdeaeffa0de60777dfe383945f9b4ed8207285cc 100644 (file)
@@ -109,7 +109,7 @@ int uni_utf8_to_decomposed_titlecase(const void *input, size_t size,
    buf. If input contains invalid UTF-8 characters, replace them with unicode
    replacement character (0xfffd), write the output to buf and return FALSE. */
 bool uni_utf8_get_valid_data(const unsigned char *input, size_t size,
-                            buffer_t *buf);
+                            buffer_t *buf) ATTR_WARN_UNUSED_RESULT;
 /* Returns TRUE if string is valid UTF-8 input. */
 bool uni_utf8_str_is_valid(const char *str);
 /* Returns TRUE if data contains only valid UTF-8 input. */