changeset 21291:f07aa4c27bed

doveadm-director: Show tag field from response Fix off-by-one in doveadm director dump
author Aki Tuomi <aki.tuomi@dovecot.fi>
date Wed, 14 Dec 2016 12:46:50 +0200
parents b272b85948e6
children 25b0616d7f1c
files src/doveadm/doveadm-director.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/doveadm/doveadm-director.c	Mon Dec 12 15:14:52 2016 +0200
+++ b/src/doveadm/doveadm-director.c	Wed Dec 14 12:46:50 2016 +0200
@@ -751,11 +751,12 @@
 			args = t_strsplit_tab(line);
 			if (str_array_length(args) >= 2) {
 				const char *host = args[0];
+				const char *tag = args[3];
 				/* this is guaranteed to be at least NULL */
-				if (args[2] != NULL &&
-				    *args[2] != '\0')
+				if (tag != NULL &&
+				    *tag != '\0')
 					host = t_strdup_printf("%s@%s", host,
-							       args[2]);
+							       tag);
 				doveadm_print("add");
 				doveadm_print(ctx->socket_path);
 				doveadm_print(host);