mirror of https://github.com/xemu-project/xemu.git
usb: mtp: avoid empty description string
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
2dc7fdf33d
commit
457d397a24
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue