From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhGpL-00038d-K3 for qemu-devel@nongnu.org; Mon, 05 May 2014 07:13:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WhGpE-0005Km-CU for qemu-devel@nongnu.org; Mon, 05 May 2014 07:12:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhGpE-0005K9-3p for qemu-devel@nongnu.org; Mon, 05 May 2014 07:12:48 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s45BClUt026605 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 5 May 2014 07:12:47 -0400 From: Gerd Hoffmann Date: Mon, 5 May 2014 13:12:36 +0200 Message-Id: <1399288360-29897-8-git-send-email-kraxel@redhat.com> In-Reply-To: <1399288360-29897-1-git-send-email-kraxel@redhat.com> References: <1399288360-29897-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 07/10] usb: mtp: avoid empty description string List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann Reviewed-by: Peter Wu Reviewed-by: Stefan Hajnoczi --- hw/usb/dev-mtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 45f9562..a30a886 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -1046,7 +1046,7 @@ static int usb_mtp_initfn(USBDevice *dev) QTAILQ_INIT(&s->objects); if (s->desc == NULL) { s->desc = strrchr(s->root, '/'); - if (s->desc) { + if (s->desc && s->desc[0]) { s->desc = g_strdup(s->desc + 1); } else { s->desc = g_strdup("none"); -- 1.8.3.1