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/umass.c | |
parent | c9c7d16545b1bfad4519f491aa113a57ab7c7b2d (diff) |
strcpy/sprintf cleanup of sys/dev. miod@, deraadt@ says to commit.
Diffstat (limited to 'sys/dev/usb/umass.c')
-rw-r--r-- | sys/dev/usb/umass.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 83d582ce726..5e9516e3515 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass.c,v 1.21 2003/01/05 22:41:36 deraadt Exp $ */ +/* $OpenBSD: umass.c,v 1.22 2003/04/27 11:22:54 ho 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>, @@ -864,7 +864,7 @@ USB_MATCH(umass) #elif defined(__NetBSD__) || defined(__OpenBSD__) struct umass_softc scs, *sc = &scs; memset(sc, 0, sizeof *sc); - strcpy(sc->sc_dev.dv_xname, "umass"); + strlcpy(sc->sc_dev.dv_xname, "umass", sizeof sc->sc_dev.dv_xname); #endif if (uaa->iface == NULL) @@ -3103,7 +3103,7 @@ umass_dump_buffer(struct umass_softc *sc, u_int8_t *buffer, int buflen, s1[0] = '\0'; s3[0] = '\0'; - sprintf(s2, " buffer=%p, buflen=%d", buffer, buflen); + snprintf(s2, sizeof s2, " buffer=%p, buflen=%d", buffer, buflen); for (i = 0; i < buflen && i < printlen; i++) { j = i % 16; if (j == 0 && i != 0) { @@ -3111,10 +3111,10 @@ umass_dump_buffer(struct umass_softc *sc, u_int8_t *buffer, int buflen, USBDEVNAME(sc->sc_dev), s1, s2)); s2[0] = '\0'; } - sprintf(&s1[j*2], "%02x", buffer[i] & 0xff); + snprintf(&s1[j*2], sizeof s1 - j*2, "%02x", buffer[i] & 0xff); } if (buflen > printlen) - sprintf(s3, " ..."); + snprintf(s3, sizeof s3, " ..."); DPRINTF(UDMASS_GEN, ("%s: 0x %s%s%s\n", USBDEVNAME(sc->sc_dev), s1, s2, s3)); } |