diff options
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/card.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c index 85e79b9ecb08..45407cb81b66 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -514,18 +514,17 @@ static void usb_audio_make_longname(struct usb_device *dev, s = preset->vendor_name; else if (quirk && quirk->vendor_name) s = quirk->vendor_name; + *card->longname = 0; if (s && *s) { - len = strlcpy(card->longname, s, sizeof(card->longname)); + strscpy(card->longname, s, sizeof(card->longname)); } else { /* retrieve the vendor and device strings as longname */ if (dev->descriptor.iManufacturer) - len = usb_string(dev, dev->descriptor.iManufacturer, - card->longname, sizeof(card->longname)); - else - len = 0; + usb_string(dev, dev->descriptor.iManufacturer, + card->longname, sizeof(card->longname)); /* we don't really care if there isn't any vendor string */ } - if (len > 0) { + if (*card->longname) { strim(card->longname); if (*card->longname) strlcat(card->longname, " ", sizeof(card->longname)); |