Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Cosmetic changes.



details:   https://anonhg.NetBSD.org/src/rev/312f36e0451f
branches:  trunk
changeset: 501881:312f36e0451f
user:      augustss <augustss%NetBSD.org@localhost>
date:      Mon Jan 08 20:21:16 2001 +0000

description:
Cosmetic changes.

diffstat:

 sys/dev/usb/usb_subr.c |  20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diffs (50 lines):

diff -r 2b2a24d319ad -r 312f36e0451f sys/dev/usb/usb_subr.c
--- a/sys/dev/usb/usb_subr.c    Mon Jan 08 20:12:51 2001 +0000
+++ b/sys/dev/usb/usb_subr.c    Mon Jan 08 20:21:16 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_subr.c,v 1.82 2000/12/13 04:05:14 augustss Exp $   */
+/*     $NetBSD: usb_subr.c,v 1.83 2001/01/08 20:21:16 augustss Exp $   */
 /*     $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $   */
 
 /*
@@ -209,6 +209,18 @@
        return (buf);
 }
 
+static void
+usbd_trim_trailings_spaces(char *p)
+{
+       char *q;
+
+       if (p == NULL)
+               return;
+       q = p + strlen(p);
+       while (--q >= p && *q == ' ')
+               *q = 0;
+}
+
 void
 usbd_devinfo_vp(usbd_device_handle dev, char *v, char *p, int usedev)
 {
@@ -225,7 +237,9 @@
 
        if (usedev) {
                vendor = usbd_get_string(dev, udd->iManufacturer, v);
+               usbd_trim_trailings_spaces(vendor);
                product = usbd_get_string(dev, udd->iProduct, p);
+               usbd_trim_trailings_spaces(product);
        } else {
                vendor = NULL;
                product = NULL;
@@ -241,9 +255,9 @@
                                break;
                }
                if (kdp->vendorname != NULL) {
-                       if (!vendor)
+                       if (vendor == NULL)
                            vendor = kdp->vendorname;
-                       if (!product)
+                       if (product == NULL)
                            product = (kdp->flags & USB_KNOWNDEV_NOPROD) == 0 ?
                                kdp->productname : NULL;
                }



Home | Main Index | Thread Index | Old Index