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/tc/tc.c | |
parent | c9c7d16545b1bfad4519f491aa113a57ab7c7b2d (diff) |
strcpy/sprintf cleanup of sys/dev. miod@, deraadt@ says to commit.
Diffstat (limited to 'sys/dev/tc/tc.c')
-rw-r--r-- | sys/dev/tc/tc.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/dev/tc/tc.c b/sys/dev/tc/tc.c index dec693d68c9..8f31502139d 100644 --- a/sys/dev/tc/tc.c +++ b/sys/dev/tc/tc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tc.c,v 1.13 2002/05/03 20:27:44 miod Exp $ */ +/* $OpenBSD: tc.c,v 1.14 2003/04/27 11:22:54 ho Exp $ */ /* $NetBSD: tc.c,v 1.29 2001/11/13 06:26:10 lukem Exp $ */ /* @@ -52,7 +52,7 @@ struct cfdriver tc_cd = { int tcprint(void *, const char *); int tcsubmatch(struct device *, void *, void *); int tc_checkslot(tc_addr_t, char *); -void tc_devinfo(const char *, char *); +void tc_devinfo(const char *, char *, size_t); int tcmatch(parent, vcf, aux) @@ -189,7 +189,7 @@ tcprint(aux, pnp) char devinfo[256]; if (pnp) { - tc_devinfo(ta->ta_modname, devinfo); + tc_devinfo(ta->ta_modname, devinfo, sizeof devinfo); printf("%s at %s", devinfo, pnp); } printf(" slot %d offset 0x%lx", ta->ta_slot, @@ -304,9 +304,7 @@ struct tc_knowndev { #endif /* TCVERBOSE */ void -tc_devinfo(id, cp) - const char *id; - char *cp; +tc_devinfo(const char *id, char *cp, size_t cp_len) { const char *driver; #ifdef TCVERBOSE @@ -332,8 +330,8 @@ tc_devinfo(id, cp) tdp++; } if (driver != NULL) - cp += sprintf(cp, "%s (%s)", driver, description); + snprintf(cp, cp_len, "%s (%s)", driver, description); else #endif - cp += sprintf(cp, "%s", id); + snprintf(cp, cp_len, "%s", id); } |