diff options
author | Hakan Olsson <ho@cvs.openbsd.org> | 2003-04-27 11:22:55 +0000 |
---|---|---|
committer | Hakan Olsson <ho@cvs.openbsd.org> | 2003-04-27 11:22:55 +0000 |
commit | c670c56d6bb9915caf18009083d3515283a25fe1 (patch) | |
tree | ffee78ad4ad468acbebd70d511be258d28fdbd52 /sys/dev/usb/usb_subr.c | |
parent | c9c7d16545b1bfad4519f491aa113a57ab7c7b2d (diff) |
strcpy/sprintf cleanup of sys/dev. miod@, deraadt@ says to commit.
Diffstat (limited to 'sys/dev/usb/usb_subr.c')
-rw-r--r-- | sys/dev/usb/usb_subr.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index 703d5f2515b..2ed030e3dbf 100644 --- a/sys/dev/usb/usb_subr.c +++ b/sys/dev/usb/usb_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb_subr.c,v 1.22 2002/07/25 02:18:11 nate Exp $ */ +/* $OpenBSD: usb_subr.c,v 1.23 2003/04/27 11:22:54 ho Exp $ */ /* $NetBSD: usb_subr.c,v 1.87 2001/08/15 00:04:59 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */ @@ -269,13 +269,15 @@ usbd_devinfo_vp(usbd_device_handle dev, char *v, char *p, int usedev) } #endif if (vendor != NULL && *vendor) - strcpy(v, vendor); + strlcpy(v, vendor, USB_MAX_STRING_LEN); /* XXX */ else - sprintf(v, "vendor 0x%04x", UGETW(udd->idVendor)); + snprintf(v, USB_MAX_STRING_LEN, "vendor 0x%04x", /* XXX */ + UGETW(udd->idVendor)); if (product != NULL && *product) - strcpy(p, product); + strlcpy(p, product, USB_MAX_STRING_LEN); /* XXX */ else - sprintf(p, "product 0x%04x", UGETW(udd->idProduct)); + snprintf(p, USB_MAX_STRING_LEN, "product 0x%04x", /* XXX */ + UGETW(udd->idProduct)); } int |