From patchwork Thu Feb 21 20:20:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Serge E. Hallyn" X-Patchwork-Id: 222410 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E41442C02A2 for ; Fri, 22 Feb 2013 07:20:20 +1100 (EST) Received: from localhost ([::1]:55314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8ccq-0002eJ-JG for incoming@patchwork.ozlabs.org; Thu, 21 Feb 2013 15:20:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8ccd-0002Rb-O8 for qemu-devel@nongnu.org; Thu, 21 Feb 2013 15:20:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8ccY-0007WE-Q6 for qemu-devel@nongnu.org; Thu, 21 Feb 2013 15:20:02 -0500 Received: from 50-56-35-84.static.cloud-ips.com ([50.56.35.84]:51189 helo=mail.hallyn.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8ccY-0007Vq-IX for qemu-devel@nongnu.org; Thu, 21 Feb 2013 15:19:58 -0500 Received: by mail.hallyn.com (Postfix, from userid 1000) id C09921C20E; Thu, 21 Feb 2013 20:20:28 +0000 (UTC) Date: Thu, 21 Feb 2013 20:20:28 +0000 From: "Serge E. Hallyn" To: qemu-devel@nongnu.org Message-ID: <20130221202028.GA2302@mail.hallyn.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 50.56.35.84 Subject: [Qemu-devel] [PATCH] fix wrong output with 'info chardev' for tcp socket. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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" : "");