Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Return the beginning of the string, not the end.



details:   https://anonhg.NetBSD.org/src/rev/9de8213fe416
branches:  trunk
changeset: 582089:9de8213fe416
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jun 16 12:55:25 2005 +0000

description:
Return the beginning of the string, not the end.

diffstat:

 sys/dev/usb/usb_subr.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r e59d5df41fc0 -r 9de8213fe416 sys/dev/usb/usb_subr.c
--- a/sys/dev/usb/usb_subr.c    Thu Jun 16 10:58:52 2005 +0000
+++ b/sys/dev/usb/usb_subr.c    Thu Jun 16 12:55:25 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_subr.c,v 1.126 2005/05/30 04:20:46 christos Exp $  */
+/*     $NetBSD: usb_subr.c,v 1.127 2005/06/16 12:55:25 christos Exp $  */
 /*     $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $   */
 
 /*
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.126 2005/05/30 04:20:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.127 2005/06/16 12:55:25 christos Exp $");
 
 #include "opt_usbverbose.h"
 
@@ -196,7 +196,7 @@
 static char *
 usbd_trim_spaces(char *b, size_t s, const char *p)
 {
-       char *q, *e;
+       char *q, *e, *bp = b;
 
        if (p == NULL)
                return NULL;
@@ -207,8 +207,8 @@
        while ((*b = *q++))     /* copy string */
                if (*b++ != ' ') /* remember last non-space */
                        e = b;
-       *e = 0;                 /* kill trailing spaces */
-       return b;
+       *e = '\0';              /* kill trailing spaces */
+       return bp;
 }
 
 Static void



Home | Main Index | Thread Index | Old Index