From patchwork Thu Feb 21 20:20:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: fix wrong output with 'info chardev' for tcp socket. From: "Serge E. Hallyn" X-Patchwork-Id: 222410 Message-Id: <20130221202028.GA2302@mail.hallyn.com> To: qemu-devel@nongnu.org Date: Thu, 21 Feb 2013 20:20:28 +0000 The snprintf format isn't taking into account the new 'left' and 'right' variables (for ipv6 []) when placing the ':', which should go immediately before the port. Signed-off-by: Serge Hallyn Reviewed-by: Michael Tokarev Reviewed-by: Michael Roth --- qemu-char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-char.c b/qemu-char.c index e4b0f53..3e152e1 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2482,7 +2482,7 @@ static CharDriverState *qemu_chr_open_socket_fd(int fd, bool do_nodelay, s->do_nodelay = do_nodelay; getnameinfo((struct sockaddr *) &ss, ss_len, host, sizeof(host), serv, sizeof(serv), NI_NUMERICHOST | NI_NUMERICSERV); - snprintf(chr->filename, 256, "%s:%s:%s%s%s%s", + snprintf(chr->filename, 256, "%s:%s%s%s:%s%s", is_telnet ? "telnet" : "tcp", left, host, right, serv, is_listen ? ",server" : "");