From c597344eb7b9b34fe4725165475fdeb1510b5172 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sun, 26 Jul 2020 04:03:12 +0200 Subject: [PATCH] Added convenience macro dynstr_append_or_ret_nonzero --- include/dynstr.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/dynstr.h b/include/dynstr.h index ee3b22b..dcdd8a1 100644 --- a/include/dynstr.h +++ b/include/dynstr.h @@ -45,7 +45,12 @@ /** * Convenience macro that calls dynstr_append and returns zero if failed. */ -#define dynstr_append_or_ret_zero( ...) if (dynstr_append( __VA_ARGS__) != DYNSTR_OK) return 0 +#define dynstr_append_or_ret_zero(...) if (dynstr_append(__VA_ARGS__) != DYNSTR_OK) return 0 + +/** + * Convenience macro that calls dynstr_append and returns zero if failed. + */ +#define dynstr_append_or_ret_nonzero(...) if (dynstr_append(__VA_ARGS__) != DYNSTR_OK) return 1 /** * Dynamic string type used for this library.