diff options
author | Hakan Olsson <ho@cvs.openbsd.org> | 2003-04-06 18:54:21 +0000 |
---|---|---|
committer | Hakan Olsson <ho@cvs.openbsd.org> | 2003-04-06 18:54:21 +0000 |
commit | 51ab7e02d9e6e7c9950f34bc0cc7cc72bb53bd12 (patch) | |
tree | 749f8097655f1aa27f2d7a4a1ecdad5e155781a5 /sys/dev/pci/if_de.c | |
parent | 0f64621783b3f46a4851826b9f4284e3c9dbeb61 (diff) |
strcat/strcpy/sprintf cleanup. krw@, anil@ ok. art@ tested sparc64.
Diffstat (limited to 'sys/dev/pci/if_de.c')
-rw-r--r-- | sys/dev/pci/if_de.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c index 8191dcc2007..34f5e02ba85 100644 --- a/sys/dev/pci/if_de.c +++ b/sys/dev/pci/if_de.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_de.c,v 1.56 2002/06/30 16:00:30 art Exp $ */ +/* $OpenBSD: if_de.c,v 1.57 2003/04/06 18:54:20 ho Exp $ */ /* $NetBSD: if_de.c,v 1.45 1997/06/09 00:34:18 thorpej Exp $ */ /*- @@ -2123,7 +2123,7 @@ static void tulip_identify_dec_nic( tulip_softc_t * const sc) { - strcpy(sc->tulip_boardid, "DEC "); + strlcpy(sc->tulip_boardid, "DEC ", sizeof sc->tulip_boardid); #define D0 4 if (sc->tulip_chipid <= TULIP_DE425) return; @@ -2140,7 +2140,7 @@ tulip_identify_znyx_nic( tulip_softc_t * const sc) { unsigned id = 0; - strcpy(sc->tulip_boardid, "ZNYX ZX3XX "); + strlcpy(sc->tulip_boardid, "ZNYX ZX3XX ", sizeof sc->tulip_boardid); if (sc->tulip_chipid == TULIP_21140 || sc->tulip_chipid == TULIP_21140A) { unsigned znyx_ptr; sc->tulip_boardid[8] = '4'; @@ -2236,17 +2236,17 @@ tulip_identify_smc_nic( int auibnc = 0, utp = 0; char *cp; - strcpy(sc->tulip_boardid, "SMC "); + strlcpy(sc->tulip_boardid, "SMC ", sizeof sc->tulip_boardid); if (sc->tulip_chipid == TULIP_21041) return; if (sc->tulip_chipid != TULIP_21040) { if (sc->tulip_boardsw != &tulip_2114x_isv_boardsw) { - strcpy(&sc->tulip_boardid[4], "9332DST "); + strlcat(sc->tulip_boardid, "9332DST ", sizeof sc->tulip_boardid); sc->tulip_boardsw = &tulip_21140_smc9332_boardsw; } else if (sc->tulip_features & (TULIP_HAVE_BASEROM|TULIP_HAVE_SLAVEDROM)) { - strcpy(&sc->tulip_boardid[4], "9334BDT "); + strlcat(sc->tulip_boardid, "9334BDT ", sizeof sc->tulip_boardid); } else { - strcpy(&sc->tulip_boardid[4], "9332BDT "); + strlcat(sc->tulip_boardid, "9332BDT ", sizeof sc->tulip_boardid); } return; } @@ -2254,7 +2254,7 @@ tulip_identify_smc_nic( id2 = sc->tulip_rombuf[0x62] | (sc->tulip_rombuf[0x63] << 8); ei = sc->tulip_rombuf[0x66] | (sc->tulip_rombuf[0x67] << 8); - strcpy(&sc->tulip_boardid[4], "8432"); + strlcat(sc->tulip_boardid, "8432", sizeof sc->tulip_boardid); cp = &sc->tulip_boardid[8]; if ((id1 & 1) == 0) *cp++ = 'B', auibnc = 1; @@ -2281,18 +2281,18 @@ static void tulip_identify_cogent_nic( tulip_softc_t * const sc) { - strcpy(sc->tulip_boardid, "Cogent "); + strlcpy(sc->tulip_boardid, "Cogent ", sizeof sc->tulip_boardid); if (sc->tulip_chipid == TULIP_21140 || sc->tulip_chipid == TULIP_21140A) { if (sc->tulip_rombuf[32] == TULIP_COGENT_EM100TX_ID) { - strcat(sc->tulip_boardid, "EM100TX "); + strlcat(sc->tulip_boardid, "EM100TX ", sizeof sc->tulip_boardid); sc->tulip_boardsw = &tulip_21140_cogent_em100_boardsw; #if defined(TULIP_COGENT_EM110TX_ID) } else if (sc->tulip_rombuf[32] == TULIP_COGENT_EM110TX_ID) { - strcat(sc->tulip_boardid, "EM110TX "); + strlcat(sc->tulip_boardid, "EM110TX ", sizeof sc->tulip_boardid); sc->tulip_boardsw = &tulip_21140_cogent_em100_boardsw; #endif } else if (sc->tulip_rombuf[32] == TULIP_COGENT_EM100FX_ID) { - strcat(sc->tulip_boardid, "EM100FX "); + strlcat(sc->tulip_boardid, "EM100FX ", sizeof sc->tulip_boardid); sc->tulip_boardsw = &tulip_21140_cogent_em100_boardsw; } /* @@ -2305,7 +2305,7 @@ tulip_identify_cogent_nic( * Cogent (Adaptec) is still mapping all INTs to INTA of * first 21140. Dumb! Dumb! */ - strcat(sc->tulip_boardid, "EM440TX "); + strlcat(sc->tulip_boardid, "EM440TX ", sizeof sc->tulip_boardid); sc->tulip_features |= TULIP_HAVE_SHAREDINTR; } } else if (sc->tulip_chipid == TULIP_21040) { @@ -2317,24 +2317,24 @@ static void tulip_identify_accton_nic( tulip_softc_t * const sc) { - strcpy(sc->tulip_boardid, "ACCTON "); + strlcpy(sc->tulip_boardid, "ACCTON ", sizeof sc->tulip_boardid); switch (sc->tulip_chipid) { case TULIP_21140A: - strcat(sc->tulip_boardid, "EN1207 "); + strlcat(sc->tulip_boardid, "EN1207 ", sizeof sc->tulip_boardid); if (sc->tulip_boardsw != &tulip_2114x_isv_boardsw) sc->tulip_boardsw = &tulip_21140_accton_boardsw; break; case TULIP_21140: - strcat(sc->tulip_boardid, "EN1207TX "); + strlcat(sc->tulip_boardid, "EN1207TX ", sizeof sc->tulip_boardid); if (sc->tulip_boardsw != &tulip_2114x_isv_boardsw) sc->tulip_boardsw = &tulip_21140_eb_boardsw; break; case TULIP_21040: - strcat(sc->tulip_boardid, "EN1203 "); + strlcat(sc->tulip_boardid, "EN1203 ", sizeof sc->tulip_boardid); sc->tulip_boardsw = &tulip_21040_boardsw; break; case TULIP_21041: - strcat(sc->tulip_boardid, "EN1203 "); + strlcat(sc->tulip_boardid, "EN1203 ", sizeof sc->tulip_boardid); sc->tulip_boardsw = &tulip_21041_boardsw; break; default: @@ -2347,7 +2347,7 @@ static void tulip_identify_asante_nic( tulip_softc_t * const sc) { - strcpy(sc->tulip_boardid, "Asante "); + strlcpy(sc->tulip_boardid, "Asante ", sizeof sc->tulip_boardid); if ((sc->tulip_chipid == TULIP_21140 || sc->tulip_chipid == TULIP_21140A) && sc->tulip_boardsw != &tulip_2114x_isv_boardsw) { tulip_media_info_t *mi = sc->tulip_mediainfo; @@ -2935,7 +2935,8 @@ tulip_read_macaddr( && root_sc->tulip_pci_busno == sc->tulip_pci_busno) { sc->tulip_features |= TULIP_HAVE_SLAVEDROM; sc->tulip_boardsw = root_sc->tulip_boardsw; - strcpy(sc->tulip_boardid, root_sc->tulip_boardid); + strlcpy(sc->tulip_boardid, root_sc->tulip_boardid, + sizeof sc->tulip_boardid); if (sc->tulip_boardsw->bd_type == TULIP_21140_ISV) { bcopy(root_sc->tulip_rombuf, sc->tulip_rombuf, sizeof(sc->tulip_rombuf)); |