~donmcc/astr

8f2fd999ba6bf5d5dd8abc905cc12cf5838d2409 — Don McCaughey 3 years ago f73ed69
Replace ternary expression with if statement.

Made the implementation of `astr_len_format_args()` more closely mirror
`astr_alloc_format_args()` by using a similar `if` statement for
error checking.
1 files changed, 2 insertions(+), 1 deletions(-)

M astr.c
M astr.c => astr.c +2 -1
@@ 62,6 62,7 @@ astr_len_format_args(char const *format, va_list arguments)
    va_list arguments_copy;
    va_copy(arguments_copy, arguments);
    int length = vsnprintf(NULL, 0, format, arguments_copy);
    return length < 0 ? 0 : length;
    if (length < 0) return 0;
    return length;
}