From a2fbae0e00ccc530ac73a7329de5f999067c734a Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 12 Mar 2003 22:55:02 +0000 Subject: less sprintf --- usr.sbin/mrouted/snmp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usr.sbin/mrouted/snmp.c') diff --git a/usr.sbin/mrouted/snmp.c b/usr.sbin/mrouted/snmp.c index 9bc9bc61b05..f3b5a265540 100644 --- a/usr.sbin/mrouted/snmp.c +++ b/usr.sbin/mrouted/snmp.c @@ -216,7 +216,8 @@ o_scalar(vp, name, length, exact, var_len, write_method) case dvmrpVersion: { static char buff[15]; - sprintf(buff, "mrouted%d.%d", PROTOCOL_VERSION, MROUTED_VERSION); + snprintf(buff, sizeof buff, "mrouted%d.%d", + PROTOCOL_VERSION, MROUTED_VERSION); *var_len = strlen(buff); return (u_char *)buff; } @@ -498,7 +499,7 @@ o_dvmrpNeighborTable(vp, name, length, exact, var_len, write_method) case dvmrpNeighborVersion: { static char buff[15]; - sprintf(buff, "%d.%d", neighbor->al_pv, neighbor->al_mv); + snprintf(buff, sizeof buff, "%d.%d", neighbor->al_pv, neighbor->al_mv); *var_len = strlen(buff); return (u_char *)buff; } -- cgit v1.2.3