diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-05-07 04:33:34 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-05-07 04:33:34 +0000 |
commit | 7d54a043f02a9ab000b00d79cd05c57c3543c898 (patch) | |
tree | cbc6051f13ebeeefabb297beec35034d1ef9b14e /sys/dev/usb | |
parent | a8b5a2d4375a4434a0a6db9a4327408aee37ac3c (diff) |
string cleanup; nate ok
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/if_aue.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/if_cue.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/if_kue.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/if_upl.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/if_url.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/uaudio.c | 45 | ||||
-rw-r--r-- | sys/dev/usb/ubsa.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/udsbr.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/uftdi.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/ugen.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/uhidev.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/uhub.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/ulpt.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/umass.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/umct.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/umidi.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/umodem.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/uplcom.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/urio.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/usb_subr.c | 37 | ||||
-rw-r--r-- | sys/dev/usb/usbdi.h | 4 | ||||
-rw-r--r-- | sys/dev/usb/usbdivar.h | 4 | ||||
-rw-r--r-- | sys/dev/usb/uscanner.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/usscanner.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/uvisor.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/uvscom.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/uyap.c | 4 |
27 files changed, 102 insertions, 80 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index d5769c78b71..a87779111b1 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_aue.c,v 1.29 2002/11/11 02:32:32 nate Exp $ */ +/* $OpenBSD: if_aue.c,v 1.30 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: if_aue.c,v 1.81 2002/09/29 19:55:52 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -730,7 +730,7 @@ USB_ATTACH(aue) DPRINTFN(5,(" : aue_attach: sc=%p", sc)); - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", USBDEVNAME(sc->aue_dev), devinfo); diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index 00e1a6067a7..ed4a9156774 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cue.c,v 1.17 2002/07/25 04:07:32 nate Exp $ */ +/* $OpenBSD: if_cue.c,v 1.18 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: if_cue.c,v 1.40 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -496,7 +496,7 @@ USB_ATTACH(cue) DPRINTFN(5,(" : cue_attach: sc=%p, dev=%p", sc, dev)); - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", USBDEVNAME(sc->cue_dev), devinfo); diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index 3fc84ad33b8..d45f30ab5c5 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_kue.c,v 1.22 2002/07/29 02:38:54 nate Exp $ */ +/* $OpenBSD: if_kue.c,v 1.23 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: if_kue.c,v 1.50 2002/07/16 22:00:31 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -434,7 +434,7 @@ USB_ATTACH(kue) DPRINTFN(5,(" : kue_attach: sc=%p, dev=%p", sc, dev)); - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", USBDEVNAME(sc->kue_dev), devinfo); diff --git a/sys/dev/usb/if_upl.c b/sys/dev/usb/if_upl.c index ed1bb59883a..72c7b99f72c 100644 --- a/sys/dev/usb/if_upl.c +++ b/sys/dev/usb/if_upl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_upl.c,v 1.13 2003/01/07 09:00:34 kjc Exp $ */ +/* $OpenBSD: if_upl.c,v 1.14 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -258,7 +258,7 @@ USB_ATTACH(upl) DPRINTFN(5,(" : upl_attach: sc=%p, dev=%p", sc, dev)); - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c index d5101b95aa0..8a4d5d18ce4 100644 --- a/sys/dev/usb/if_url.c +++ b/sys/dev/usb/if_url.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_url.c,v 1.10 2003/01/27 20:10:52 jason Exp $ */ +/* $OpenBSD: if_url.c,v 1.11 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */ /* * Copyright (c) 2001, 2002 @@ -211,7 +211,7 @@ USB_ATTACH(url) u_char eaddr[ETHER_ADDR_LEN]; int i, s; - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", devname, devinfo); diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c index 649a2f7bb0f..68e709ee280 100644 --- a/sys/dev/usb/uaudio.c +++ b/sys/dev/usb/uaudio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uaudio.c,v 1.14 2003/04/27 11:22:54 ho Exp $ */ +/* $OpenBSD: uaudio.c,v 1.15 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: uaudio.c,v 1.60 2002/05/18 15:14:39 kent Exp $ */ /* @@ -360,7 +360,7 @@ USB_ATTACH(uaudio) usbd_status err; int i, j, found; - usbd_devinfo(uaa->device, 0, devinfo); + usbd_devinfo(uaa->device, 0, devinfo, sizeof devinfo); printf(": %s\n", devinfo); sc->sc_udev = uaa->device; @@ -611,7 +611,7 @@ char * uaudio_id_name(struct uaudio_softc *sc, usb_descriptor_t **dps, int id) { static char buf[32]; - sprintf(buf, "i%d", id); + snprintf(buf, sizeof buf, "i%d", id); return (buf); } @@ -762,7 +762,8 @@ uaudio_add_mixer(struct uaudio_softc *sc, usb_descriptor_t *v, mix.wValue[k++] = MAKE(p+c+1, o+1); } - sprintf(mix.ctlname, "mix%d-%s", d->bUnitId, + snprintf(mix.ctlname, sizeof mix.ctlname, + "mix%d-%s", d->bUnitId, uaudio_id_name(sc, dps, d->baSourceId[i])); mix.nchan = chs; uaudio_mixer_add_ctl(sc, &mix); @@ -844,35 +845,40 @@ uaudio_add_feature(struct uaudio_softc *sc, usb_descriptor_t *v, switch (ctl) { case MUTE_CONTROL: mix.type = MIX_ON_OFF; - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + snprintf(mix.ctlname, sizeof mix.ctlname, + "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNmute); mix.ctlunit = ""; break; case VOLUME_CONTROL: mix.type = MIX_SIGNED_16; - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + snprintf(mix.ctlname, sizeof mix.ctlname, + "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNmaster); mix.ctlunit = AudioNvolume; break; case BASS_CONTROL: mix.type = MIX_SIGNED_8; - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + snprintf(mix.ctlname, sizeof mix.ctlname, + "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNbass); mix.ctlunit = AudioNbass; break; case MID_CONTROL: mix.type = MIX_SIGNED_8; - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + snprintf(mix.ctlname, sizeof mix.ctlname, + "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNmid); mix.ctlunit = AudioNmid; break; case TREBLE_CONTROL: mix.type = MIX_SIGNED_8; - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + snprintf(mix.ctlname, sizeof mix.ctlname, + "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNtreble); mix.ctlunit = AudioNtreble; @@ -882,28 +888,32 @@ uaudio_add_feature(struct uaudio_softc *sc, usb_descriptor_t *v, break; case AGC_CONTROL: mix.type = MIX_ON_OFF; - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + snprintf(mix.ctlname, sizeof mix.ctlname, + "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNagc); mix.ctlunit = ""; break; case DELAY_CONTROL: mix.type = MIX_UNSIGNED_16; - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + snprintf(mix.ctlname, sizeof mix.ctlname, + "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNdelay); mix.ctlunit = "4 ms"; break; case BASS_BOOST_CONTROL: mix.type = MIX_ON_OFF; - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + snprintf(mix.ctlname, sizeof mix.ctlname, + "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNbassboost); mix.ctlunit = ""; break; case LOUDNESS_CONTROL: mix.type = MIX_ON_OFF; - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + snprintf(mix.ctlname, sizeof mix.ctlname, + "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNloudness); mix.ctlunit = ""; @@ -941,7 +951,8 @@ uaudio_add_processing_updown(struct uaudio_softc *sc, usb_descriptor_t *v, mix.class = -1; mix.type = MIX_ON_OFF; /* XXX */ mix.ctlunit = ""; - sprintf(mix.ctlname, "pro%d-mode", d->bUnitId); + snprintf(mix.ctlname, sizeof mix.ctlname, + "pro%d-mode", d->bUnitId); for (i = 0; i < ud->bNrModes; i++) { DPRINTFN(2,("uaudio_add_processing_updown: i=%d bm=0x%x\n", @@ -972,7 +983,8 @@ uaudio_add_processing(struct uaudio_softc *sc, usb_descriptor_t *v, mix.class = -1; mix.type = MIX_ON_OFF; mix.ctlunit = ""; - sprintf(mix.ctlname, "pro%d.%d-enable", d->bUnitId, ptype); + snprintf(mix.ctlname, sizeof mix.ctlname, + "pro%d.%d-enable", d->bUnitId, ptype); uaudio_mixer_add_ctl(sc, &mix); } @@ -1017,7 +1029,8 @@ uaudio_add_extension(struct uaudio_softc *sc, usb_descriptor_t *v, mix.class = -1; mix.type = MIX_ON_OFF; mix.ctlunit = ""; - sprintf(mix.ctlname, "ext%d-enable", d->bUnitId); + snprintf(mix.ctlname, sizeof mix.ctlname, + "ext%d-enable", d->bUnitId); uaudio_mixer_add_ctl(sc, &mix); } } diff --git a/sys/dev/usb/ubsa.c b/sys/dev/usb/ubsa.c index a48a16e59f2..7946f99cb3f 100644 --- a/sys/dev/usb/ubsa.c +++ b/sys/dev/usb/ubsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubsa.c,v 1.1 2002/11/30 19:29:29 nate Exp $ */ +/* $OpenBSD: ubsa.c,v 1.2 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: ubsa.c,v 1.3 2002/10/27 20:16:41 augustss Exp $ */ /*- * Copyright (c) 2002, Alexander Kabaev <kan.FreeBSD.org>. @@ -262,7 +262,7 @@ USB_ATTACH(ubsa) struct ucom_attach_args uca; int i; - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", devname, devinfo); diff --git a/sys/dev/usb/udsbr.c b/sys/dev/usb/udsbr.c index 08500900a79..d990c68f4fd 100644 --- a/sys/dev/usb/udsbr.c +++ b/sys/dev/usb/udsbr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udsbr.c,v 1.5 2002/07/25 04:07:32 nate Exp $ */ +/* $OpenBSD: udsbr.c,v 1.6 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: udsbr.c,v 1.7 2002/07/11 21:14:27 augustss Exp $ */ /* @@ -127,7 +127,7 @@ USB_ATTACH(udsbr) DPRINTFN(10,("udsbr_attach: sc=%p\n", sc)); - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c index 7fdefc3b500..d59d5d8ee47 100644 --- a/sys/dev/usb/uftdi.c +++ b/sys/dev/usb/uftdi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uftdi.c,v 1.10 2002/11/11 02:32:32 nate Exp $ */ +/* $OpenBSD: uftdi.c,v 1.11 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: uftdi.c,v 1.13 2002/09/23 05:51:23 simonb Exp $ */ /* @@ -173,7 +173,7 @@ USB_ATTACH(uftdi) goto bad; } - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", devname, devinfo); diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index bf301035167..b723a308f15 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugen.c,v 1.26 2002/11/11 02:32:32 nate Exp $ */ +/* $OpenBSD: ugen.c,v 1.27 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: ugen.c,v 1.62 2002/10/23 09:13:59 jdolecek Exp $ */ /* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -203,7 +203,7 @@ USB_ATTACH(ugen) usbd_status err; int conf; - usbd_devinfo(uaa->device, 0, devinfo); + usbd_devinfo(uaa->device, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index ffaddf7e034..d0bc558a77e 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.6 2002/11/11 02:32:32 nate Exp $ */ +/* $OpenBSD: uhidev.c,v 1.7 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: uhidev.c,v 1.10 2002/10/09 06:27:09 fair Exp $ */ /* @@ -120,7 +120,7 @@ USB_ATTACH(uhidev) sc->sc_udev = uaa->device; sc->sc_iface = iface; id = usbd_get_interface_descriptor(iface); - usbd_devinfo(uaa->device, 0, devinfo); + usbd_devinfo(uaa->device, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev), devinfo, id->bInterfaceClass, id->bInterfaceSubClass); diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 2e1fa1b445f..cb39b06c3ad 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhub.c,v 1.18 2002/07/25 02:18:10 nate Exp $ */ +/* $OpenBSD: uhub.c,v 1.19 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: uhub.c,v 1.52 2001/10/26 17:53:59 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */ @@ -156,7 +156,7 @@ USB_ATTACH(uhub) DPRINTFN(1,("uhub_attach\n")); sc->sc_hub = dev; - usbd_devinfo(dev, 1, devinfo); + usbd_devinfo(dev, 1, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c index 025f25b9415..21e047416bd 100644 --- a/sys/dev/usb/ulpt.c +++ b/sys/dev/usb/ulpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ulpt.c,v 1.15 2002/11/11 02:32:32 nate Exp $ */ +/* $OpenBSD: ulpt.c,v 1.16 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: ulpt.c,v 1.55 2002/10/23 09:14:01 jdolecek Exp $ */ /* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */ @@ -213,7 +213,7 @@ USB_ATTACH(ulpt) int i, altno; DPRINTFN(10,("ulpt_attach: sc=%p\n", sc)); - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev), devinfo, ifcd->bInterfaceClass, ifcd->bInterfaceSubClass); diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 5e9516e3515..ae7dc941aa6 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass.c,v 1.22 2003/04/27 11:22:54 ho Exp $ */ +/* $OpenBSD: umass.c,v 1.23 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: umass.c,v 1.49 2001/01/21 18:56:38 augustss Exp $ */ /*- * Copyright (c) 1999 MAEKAWA Masahide <bishop@rr.iij4u.or.jp>, @@ -890,7 +890,7 @@ USB_ATTACH(umass) * call umass_detach without specifically initialising the struct. */ - usbd_devinfo(uaa->device, 0, devinfo); + usbd_devinfo(uaa->device, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; sc->iface = uaa->iface; diff --git a/sys/dev/usb/umct.c b/sys/dev/usb/umct.c index 90a8fc78b11..6246e03fe87 100644 --- a/sys/dev/usb/umct.c +++ b/sys/dev/usb/umct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umct.c,v 1.6 2002/11/11 02:32:32 nate Exp $ */ +/* $OpenBSD: umct.c,v 1.7 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: umct.c,v 1.9 2002/09/23 05:51:23 simonb Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -179,7 +179,7 @@ USB_ATTACH(umct) int i, found; struct ucom_attach_args uca; - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", devname, devinfo); diff --git a/sys/dev/usb/umidi.c b/sys/dev/usb/umidi.c index fee783d966a..c080be52ed6 100644 --- a/sys/dev/usb/umidi.c +++ b/sys/dev/usb/umidi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umidi.c,v 1.7 2002/11/11 02:32:32 nate Exp $ */ +/* $OpenBSD: umidi.c,v 1.8 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: umidi.c,v 1.16 2002/07/11 21:14:32 augustss Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -166,7 +166,7 @@ USB_ATTACH(umidi) DPRINTFN(1,("umidi_attach\n")); - usbd_devinfo(uaa->device, 0, devinfo); + usbd_devinfo(uaa->device, 0, devinfo, sizeof devinfo); printf("\n%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); sc->sc_iface = uaa->iface; diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c index 7b1b600e204..96b5c9b9cc9 100644 --- a/sys/dev/usb/umodem.c +++ b/sys/dev/usb/umodem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umodem.c,v 1.13 2002/11/11 02:32:32 nate Exp $ */ +/* $OpenBSD: umodem.c,v 1.14 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: umodem.c,v 1.45 2002/09/23 05:51:23 simonb Exp $ */ /* @@ -193,7 +193,7 @@ USB_ATTACH(umodem) int i; struct ucom_attach_args uca; - usbd_devinfo(uaa->device, 0, devinfo); + usbd_devinfo(uaa->device, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; sc->sc_udev = dev; diff --git a/sys/dev/usb/uplcom.c b/sys/dev/usb/uplcom.c index 8e048b535e8..6a15bb0682a 100644 --- a/sys/dev/usb/uplcom.c +++ b/sys/dev/usb/uplcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uplcom.c,v 1.8 2002/11/11 02:32:32 nate Exp $ */ +/* $OpenBSD: uplcom.c,v 1.9 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: uplcom.c,v 1.29 2002/09/23 05:51:23 simonb Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -195,7 +195,7 @@ USB_ATTACH(uplcom) int i; struct ucom_attach_args uca; - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", devname, devinfo); diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c index 4e7a1e8b9c8..bdfff2bdf58 100644 --- a/sys/dev/usb/urio.c +++ b/sys/dev/usb/urio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: urio.c,v 1.15 2002/11/11 02:32:32 nate Exp $ */ +/* $OpenBSD: urio.c,v 1.16 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: urio.c,v 1.15 2002/10/23 09:14:02 jdolecek Exp $ */ /* @@ -170,7 +170,7 @@ USB_ATTACH(urio) DPRINTFN(10,("urio_attach: sc=%p\n", sc)); - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index 2ed030e3dbf..8d59e0c770f 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.23 2003/04/27 11:22:54 ho Exp $ */ +/* $OpenBSD: usb_subr.c,v 1.24 2003/05/07 04:33:33 deraadt 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 $ */ @@ -281,31 +281,39 @@ usbd_devinfo_vp(usbd_device_handle dev, char *v, char *p, int usedev) } int -usbd_printBCD(char *cp, int bcd) +usbd_printBCD(char *cp, size_t len, int bcd) { - return (sprintf(cp, "%x.%02x", bcd >> 8, bcd & 0xff)); + return (snprintf(cp, len, "%x.%02x", bcd >> 8, bcd & 0xff)); } void -usbd_devinfo(usbd_device_handle dev, int showclass, char *cp) +usbd_devinfo(usbd_device_handle dev, int showclass, char *base, size_t len) { usb_device_descriptor_t *udd = &dev->ddesc; char vendor[USB_MAX_STRING_LEN]; char product[USB_MAX_STRING_LEN]; + char *cp = base; int bcdDevice, bcdUSB; usbd_devinfo_vp(dev, vendor, product, 1); - cp += sprintf(cp, "%s %s", vendor, product); - if (showclass) - cp += sprintf(cp, ", class %d/%d", - udd->bDeviceClass, udd->bDeviceSubClass); + snprintf(cp, len, "%s %s", vendor, product); + cp += strlen(cp); + if (showclass) { + snprintf(cp, base + len - cp, ", class %d/%d", + udd->bDeviceClass, udd->bDeviceSubClass); + cp += strlen(cp); + } bcdUSB = UGETW(udd->bcdUSB); bcdDevice = UGETW(udd->bcdDevice); - cp += sprintf(cp, ", rev "); - cp += usbd_printBCD(cp, bcdUSB); + snprintf(cp, base + len - cp, ", rev "); + cp += strlen(cp); + usbd_printBCD(cp, base + len - cp, bcdUSB); + cp += strlen(cp); *cp++ = '/'; - cp += usbd_printBCD(cp, bcdDevice); - cp += sprintf(cp, ", addr %d", dev->address); + usbd_printBCD(cp, base + len - cp, bcdDevice); + cp += strlen(cp); + snprintf(cp, base + len - cp, ", addr %d", dev->address); + cp += strlen(cp); *cp = 0; } @@ -1101,7 +1109,7 @@ usbd_print(void *aux, const char *pnp) if (pnp) { if (!uaa->usegeneric) return (QUIET); - usbd_devinfo(uaa->device, 1, devinfo); + usbd_devinfo(uaa->device, 1, devinfo, sizeof devinfo); printf("%s, %s", devinfo, pnp); } if (uaa->port != 0) @@ -1196,7 +1204,8 @@ usbd_fill_deviceinfo(usbd_device_handle dev, struct usb_device_info *di, di->udi_addr = dev->address; di->udi_cookie = dev->cookie; usbd_devinfo_vp(dev, di->udi_vendor, di->udi_product, usedev); - usbd_printBCD(di->udi_release, UGETW(dev->ddesc.bcdDevice)); + usbd_printBCD(di->udi_release, sizeof di->udi_release, + UGETW(dev->ddesc.bcdDevice)); di->udi_vendorNo = UGETW(dev->ddesc.idVendor); di->udi_productNo = UGETW(dev->ddesc.idProduct); di->udi_releaseNo = UGETW(dev->ddesc.bcdDevice); diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h index fc879569bd2..6f7651443f5 100644 --- a/sys/dev/usb/usbdi.h +++ b/sys/dev/usb/usbdi.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdi.h,v 1.18 2002/07/25 02:18:11 nate Exp $ */ +/* $OpenBSD: usbdi.h,v 1.19 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: usbdi.h,v 1.53 2001/08/15 00:04:59 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.h,v 1.18 1999/11/17 22:33:49 n_hibma Exp $ */ @@ -168,7 +168,7 @@ const char *usbd_errstr(usbd_status err); void usbd_add_dev_event(int, usbd_device_handle); void usbd_add_drv_event(int, usbd_device_handle, device_ptr_t); -void usbd_devinfo(usbd_device_handle, int, char *); +void usbd_devinfo(usbd_device_handle, int, char *, size_t); const struct usbd_quirks *usbd_get_quirks(usbd_device_handle); usb_endpoint_descriptor_t *usbd_get_endpoint_descriptor (usbd_interface_handle iface, u_int8_t address); diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h index 0b1b6d69f30..8b815ad5540 100644 --- a/sys/dev/usb/usbdivar.h +++ b/sys/dev/usb/usbdivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdivar.h,v 1.17 2002/07/25 02:18:11 nate Exp $ */ +/* $OpenBSD: usbdivar.h,v 1.18 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: usbdivar.h,v 1.63 2001/01/21 19:00:06 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $ */ @@ -242,7 +242,7 @@ usbd_status usbd_new_device(device_ptr_t parent, int lowspeed, int port, struct usbd_port *); void usbd_remove_device(usbd_device_handle, struct usbd_port *); -int usbd_printBCD(char *cp, int bcd); +int usbd_printBCD(char *cp, size_t len, int bcd); usbd_status usbd_fill_iface_data(usbd_device_handle dev, int i, int a); void usb_free_device(usbd_device_handle); diff --git a/sys/dev/usb/uscanner.c b/sys/dev/usb/uscanner.c index 7c84360c58c..950a0f2db40 100644 --- a/sys/dev/usb/uscanner.c +++ b/sys/dev/usb/uscanner.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uscanner.c,v 1.13 2002/11/11 02:32:32 nate Exp $ */ +/* $OpenBSD: uscanner.c,v 1.14 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: uscanner.c,v 1.34 2002/10/23 09:14:03 jdolecek Exp $ */ /* @@ -306,7 +306,7 @@ USB_ATTACH(uscanner) int i; usbd_status err; - usbd_devinfo(uaa->device, 0, devinfo); + usbd_devinfo(uaa->device, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); diff --git a/sys/dev/usb/usscanner.c b/sys/dev/usb/usscanner.c index 8c8ba11d4aa..7479f6c72b6 100644 --- a/sys/dev/usb/usscanner.c +++ b/sys/dev/usb/usscanner.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usscanner.c,v 1.6 2002/07/25 02:18:11 nate Exp $ */ +/* $OpenBSD: usscanner.c,v 1.7 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: usscanner.c,v 1.6 2001/01/23 14:04:14 augustss Exp $ */ /* @@ -198,7 +198,7 @@ USB_ATTACH(usscanner) DPRINTFN(10,("usscanner_attach: sc=%p\n", sc)); - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); diff --git a/sys/dev/usb/uvisor.c b/sys/dev/usb/uvisor.c index beba0436877..3017b9626aa 100644 --- a/sys/dev/usb/uvisor.c +++ b/sys/dev/usb/uvisor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvisor.c,v 1.13 2002/11/11 02:31:51 nate Exp $ */ +/* $OpenBSD: uvisor.c,v 1.14 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: uvisor.c,v 1.17 2002/08/13 11:38:15 augustss Exp $ */ /* @@ -215,7 +215,7 @@ USB_ATTACH(uvisor) goto bad; } - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", devname, devinfo); diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c index 041d8c2abb8..54a556b8f8b 100644 --- a/sys/dev/usb/uvscom.c +++ b/sys/dev/usb/uvscom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvscom.c,v 1.1 2002/11/30 19:09:59 nate Exp $ */ +/* $OpenBSD: uvscom.c,v 1.2 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: uvscom.c,v 1.7 2002/09/23 05:51:23 simonb Exp $ */ /*- * Copyright (c) 2001-2002, Shunsuke Akiyama <akiyama@jp.FreeBSD.org>. @@ -275,7 +275,7 @@ USB_ATTACH(uvscom) int i; struct ucom_attach_args uca; - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", devname, devinfo); diff --git a/sys/dev/usb/uyap.c b/sys/dev/usb/uyap.c index b269f375669..846c519e421 100644 --- a/sys/dev/usb/uyap.c +++ b/sys/dev/usb/uyap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uyap.c,v 1.6 2002/07/25 04:07:33 nate Exp $ */ +/* $OpenBSD: uyap.c,v 1.7 2003/05/07 04:33:33 deraadt Exp $ */ /* $NetBSD: uyap.c,v 1.6 2002/07/11 21:14:37 augustss Exp $ */ /* @@ -87,7 +87,7 @@ USB_ATTACH(uyap) usbd_status err; char devinfo[1024]; - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(dev, 0, devinfo, sizeof devinfo); USB_ATTACH_SETUP; printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); printf("%s: downloading firmware\n", USBDEVNAME(sc->sc_dev)); |