Skip to content

Commit

Permalink
doveadm: error to print formatted without format
Browse files Browse the repository at this point in the history
This changes the segfault of `doveadm -f formatted ...` to an error.
  • Loading branch information
mrannanj authored and GitLab committed May 7, 2016
1 parent 5b02d21 commit 44aebbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/doveadm/doveadm-print-formatted.c
Expand Up @@ -53,6 +53,9 @@ static void doveadm_print_formatted_flush(void)

static void doveadm_print_formatted_print(const char *value)
{
if (ctx.format == NULL) {
i_fatal("formatted formatter cannot be used without a format.");
}
struct var_expand_table *entry = array_idx_modifiable(&ctx.headers, ctx.idx++);
entry->value = value;

Expand Down

0 comments on commit 44aebbf

Please sign in to comment.