summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-16 19:45:28 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-16 19:45:28 +0000
commitcdf50ab163aa51be784346e28815b85963d0f89f (patch)
treefbc1c0f01145bb64771dbf6da995aad504d81ccc
parentc3f7e69aa593dc85cfd344705991ce7673eecacc (diff)
use snprintf to avoid crossing the overflow point; ok otto
-rw-r--r--sys/dev/usb/usb_subr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index 727944cabde..0d8b1fbb272 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.34 2005/04/16 18:40:55 deraadt Exp $ */
+/* $OpenBSD: usb_subr.c,v 1.35 2005/04/16 19:45:27 deraadt Exp $ */
/* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -326,7 +326,7 @@ usbd_devinfo(usbd_device_handle dev, int showclass, char *base, size_t len)
cp += strlen(cp);
if (showclass) {
snprintf(cp, base + len - cp, ", class %d/%d",
- udd->bDeviceClass, udd->bDeviceSubClass);
+ udd->bDeviceClass, udd->bDeviceSubClass);
cp += strlen(cp);
}
bcdUSB = UGETW(udd->bcdUSB);
@@ -335,7 +335,8 @@ usbd_devinfo(usbd_device_handle dev, int showclass, char *base, size_t len)
cp += strlen(cp);
usbd_printBCD(cp, base + len - cp, bcdUSB);
cp += strlen(cp);
- *cp++ = '/';
+ snprintf(cp, base + len - cp, "/");
+ cp += strlen(cp);
usbd_printBCD(cp, base + len - cp, bcdDevice);
cp += strlen(cp);
snprintf(cp, base + len - cp, ", addr %d", dev->address);