]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Use doveadm_print_empty()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 25 Aug 2025 09:51:05 +0000 (12:51 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 25 Aug 2025 09:51:05 +0000 (12:51 +0300)
src/doveadm/doveadm-log.c
src/doveadm/doveadm-mail-mailbox-cache.c
src/doveadm/doveadm-mail-mailbox-metadata.c
src/doveadm/doveadm-master.c
src/doveadm/doveadm-who.c
src/plugins/acl/doveadm-acl.c
src/plugins/mail-crypt/doveadm-mail-crypt.c

index 1b1d39d1153f43690988a04c57f766eb70c48eab..124af99111d984071de79cb903963026e1b289d5 100644 (file)
@@ -366,7 +366,7 @@ static void cmd_log_error_write(const struct log_error *error)
        doveadm_print(t_strdup_printf("%s.%06u", ts_secs,
                                      (unsigned int)error->timestamp.tv_usec));
        if (error->prefix[0] == '\0')
-               doveadm_print("");
+               doveadm_print_empty(1);
        else {
                const char *prefix = t_strconcat(
                        t_cmd_log_error_trim(error->prefix), ": ", NULL);
index 7cef0a4f99fbf16b6b8af0d049e4ccf6f97e6933..40b6aa2dba4a3b7a14f828822cd60d251abc5bfe 100644 (file)
@@ -146,7 +146,7 @@ cmd_mailbox_cache_decision_run_per_field(struct mailbox_cache_cmd_context *ctx,
                                                              *field_name);
                if (idx == UINT_MAX) {
                        doveadm_print("<not found>");
-                       doveadm_print("");
+                       doveadm_print_empty(1);
                        continue;
                }
 
index c97be854e161ca1935f297afd887bcfe074e1648..a6faef8b0b7e95b3eced985203e5af7506d7e9c3 100644 (file)
@@ -244,7 +244,7 @@ cmd_mailbox_metadata_get_run(struct doveadm_mail_cmd_context *_ctx,
                doveadm_mail_failed_mailbox(_ctx, box);
        } else if (ret == 0) {
                /* not found, print as empty */
-               doveadm_print("");
+               doveadm_print_empty(1);
        } else if (value.value_stream != NULL) {
                if (doveadm_print_istream(value.value_stream) < 0) {
                        e_error(ctx->ctx.cctx->event, "read(%s) failed: %s",
index d7674979fe87c1b03338ed9329f83f09a2e9de23..7cac68b36af3d96c4c8af59c3296ae7ef4f7622b 100644 (file)
@@ -211,8 +211,7 @@ static void cmd_service_status(struct doveadm_cmd_context *cctx)
                                unsigned int i;
                                for (i = 0; i < fields_count && args[i] != NULL; i++)
                                        doveadm_print(args[i]);
-                               for (; i < fields_count; i++)
-                                       doveadm_print("");
+                               doveadm_print_empty(fields_count - i);
                        }
                } T_END;
        }
index 2aae5ed684bb08f02de9fcec80e58b50605e229a..ec768d7e7d6a118cb4affe06b728260d1cd220a0 100644 (file)
@@ -452,8 +452,7 @@ who_print_line(struct who_context *ctx, struct doveadm_who_iter *iter,
 
        for (alt_idx = 0; line->alt_usernames[alt_idx] != NULL; alt_idx++)
                doveadm_print(line->alt_usernames[alt_idx]);
-       for (; alt_idx < iter->alt_username_fields_count; alt_idx++)
-               doveadm_print("");
+       doveadm_print_empty(iter->alt_username_fields_count - alt_idx);
 }
 
 static void cmd_who(struct doveadm_cmd_context *cctx)
index 25f6350485e8d6807c412fcb12a6884379e3f52e..a99aad722a978af299850caaecf7af75197bea12 100644 (file)
@@ -62,7 +62,7 @@ static void cmd_acl_get_right(const struct acl_rights *rights)
        if (rights->global)
                doveadm_print("global");
        else
-               doveadm_print("");
+               doveadm_print_empty(1);
 
        str = t_str_new(256);
        if (rights->rights != NULL)
index ea4fc2e35eeda90f77ad3c877b25e1eec4d09a77..66bfe9d6ebd9a3e6ea2205e92b07d8f6d11dbb53 100644 (file)
@@ -690,13 +690,13 @@ static void cmd_mcp_key_export_cb(const struct generated_key *key,
                if (ret == 0)
                        error = "key not found";
                doveadm_print(t_strdup_printf("ERROR: %s", error));
-               doveadm_print("");
+               doveadm_print_empty(1);
        } else {
                string_t *out = t_str_new(64);
                if (!dcrypt_key_store_private(pkey, DCRYPT_FORMAT_PEM, NULL, out,
                                              NULL, NULL, &error)) {
                        doveadm_print(t_strdup_printf("ERROR: %s", error));
-                       doveadm_print("");
+                       doveadm_print_empty(1);
                } else {
                        /* this is to make it more compatible with openssl cli
                           as it expects BEGIN on its own line */