summaryrefslogtreecommitdiff
path: root/sys/dev/tc
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>2003-04-27 11:22:55 +0000
committerHakan Olsson <ho@cvs.openbsd.org>2003-04-27 11:22:55 +0000
commitc670c56d6bb9915caf18009083d3515283a25fe1 (patch)
treeffee78ad4ad468acbebd70d511be258d28fdbd52 /sys/dev/tc
parentc9c7d16545b1bfad4519f491aa113a57ab7c7b2d (diff)
strcpy/sprintf cleanup of sys/dev. miod@, deraadt@ says to commit.
Diffstat (limited to 'sys/dev/tc')
-rw-r--r--sys/dev/tc/tc.c14
-rw-r--r--sys/dev/tc/tcvar.h4
2 files changed, 8 insertions, 10 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);
}
diff --git a/sys/dev/tc/tcvar.h b/sys/dev/tc/tcvar.h
index 4c563692a76..35a5db9bc30 100644
--- a/sys/dev/tc/tcvar.h
+++ b/sys/dev/tc/tcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcvar.h,v 1.10 2002/05/02 22:56:06 miod Exp $ */
+/* $OpenBSD: tcvar.h,v 1.11 2003/04/27 11:22:54 ho Exp $ */
/* $NetBSD: tcvar.h,v 1.17 2000/06/04 19:15:15 cgd Exp $ */
/*
@@ -140,7 +140,7 @@ struct tc_builtin {
* Interrupt establishment functions.
*/
int tc_checkslot(tc_addr_t, char *);
-void tc_devinfo(const char *, char *);
+void tc_devinfo(const char *, char *, size_t);
void tcattach(struct device *, struct device *, void *);
const struct evcnt *tc_intr_evcnt(struct device *, void *);
void tc_intr_establish(struct device *, void *, int, int (*)(void *),