]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: str - Add str_clear() and str_clear_safe().
authorStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 6 Jan 2023 15:43:56 +0000 (16:43 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 27 Jan 2023 09:34:54 +0000 (09:34 +0000)
src/lib/str.h

index f0ec8f1f4fb3c28f17c245bea7edcbc5b6864646..0fc148ec94e6f6d011cedf79f74a2ee80985b1fa 100644 (file)
@@ -91,6 +91,16 @@ static inline void str_truncate(string_t *str, size_t len)
                buffer_set_used_size(str, len);
 }
 
+/* Clear the string */
+static inline void str_clear(string_t *str)
+{
+       buffer_clear(str);
+}
+static inline void str_clear_safe(string_t *str)
+{
+       buffer_clear_safe(str);
+}
+
 /* Truncate the string to specified length, but also make sure the truncation
    doesn't happen in the middle of an UTF-8 character sequence. In that case,
    the string will end up being up to a few bytes smaller than len. If it's