diff options
author | 2003-03-13 06:10:49 +0000 | |
---|---|---|
committer | 2003-03-13 06:10:49 +0000 | |
commit | f0caa53eb8e4ceb819add8808c65ef011d754be4 (patch) | |
tree | 7cad054521c6593f67e2ec3751f12a9e5e56c150 | |
parent | more strlcpy; most from Hans-Joerg.Hoexer@yerbouti.franken.de, a bit from me (diff) | |
download | wireguard-openbsd-f0caa53eb8e4ceb819add8808c65ef011d754be4.tar.xz wireguard-openbsd-f0caa53eb8e4ceb819add8808c65ef011d754be4.zip |
zap two sprintf, more to go
-rw-r--r-- | sbin/routed/table.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/routed/table.c b/sbin/routed/table.c index 584ff692e12..44a82e2555f 100644 --- a/sbin/routed/table.c +++ b/sbin/routed/table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table.c,v 1.8 2002/05/26 09:24:35 deraadt Exp $ */ +/* $OpenBSD: table.c,v 1.9 2003/03/13 06:10:49 deraadt Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -602,7 +602,7 @@ rtm_type_name(u_char type) if (type > sizeof(rtm_types)/sizeof(rtm_types[0]) || type == 0) { - sprintf(name0, "RTM type %#x", type); + snprintf(name0, sizeof name0, "RTM type %#x", type); return name0; } else { return rtm_types[type-1]; @@ -1674,7 +1674,7 @@ rtswitch(struct rt_entry *rt, return; swap = rt->rt_spares[0]; - (void)sprintf(label, "Use #%d", (int)(rts - rt->rt_spares)); + (void)snprintf(label, sizeof label, "Use #%d", (int)(rts - rt->rt_spares)); rtchange(rt, rt->rt_state & ~(RS_NET_SYN | RS_RDISC), rts->rts_gate, rts->rts_router, rts->rts_metric, rts->rts_tag, rts->rts_ifp, rts->rts_time, label); |