changeset 21421:b2f4b698fd3c

doveadm direcor add: Fix checking number as hostname. 521c0460fe705f32ea6899c8b1f101043fe0898c was completely broken.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Tue, 17 Jan 2017 20:34:51 +0200
parents be975b41463b
children aa57a51c8ce6
files src/doveadm/doveadm-director.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/doveadm/doveadm-director.c	Tue Jan 17 20:03:40 2017 +0200
+++ b/src/doveadm/doveadm-director.c	Tue Jan 17 20:34:51 2017 +0200
@@ -453,10 +453,10 @@
 		director_cmd_help(cctx->cmd);
 		return;
 	}
-	if (str_to_uint(host, &i) == 0) {
+	if (str_to_uint(ctx->host, &i) == 0) {
 		/* host is a number. this would translate to an IP address,
 		   which is probably a mistake. */
-		i_error("Invalid host '%s'", host);
+		i_error("Invalid host '%s'", ctx->host);
 		director_cmd_help(cctx->cmd);
 		return;
 	}