summaryrefslogtreecommitdiff
path: root/sbin/routed
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-06 00:45:13 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-06 00:45:13 +0000
commit057d758e78c071130b4f93385190d9c5aea0b8b7 (patch)
tree0c871f4299ff9b0b1ec8f4fb08c1f18b98fd605e /sbin/routed
parent5b13269d7ba4c60cfa150b2f5d5f343b8fa5aa38 (diff)
string handling; ok millert
Diffstat (limited to 'sbin/routed')
-rw-r--r--sbin/routed/rtquery/rtquery.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sbin/routed/rtquery/rtquery.c b/sbin/routed/rtquery/rtquery.c
index c4230a090c6..5eb187701c2 100644
--- a/sbin/routed/rtquery/rtquery.c
+++ b/sbin/routed/rtquery/rtquery.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtquery.c,v 1.12 2003/04/04 00:46:24 deraadt Exp $ */
+/* $OpenBSD: rtquery.c,v 1.13 2003/04/06 00:45:12 deraadt Exp $ */
/*-
* Copyright (c) 1982, 1986, 1993
@@ -492,16 +492,22 @@ rip_input(struct sockaddr_in *from,
if (mask != 0) {
sp = &net_buf[strlen(net_buf)];
if (IMSG.rip_vers == RIPv1) {
- sprintf(sp," mask=%#x ? ",mask);
+ snprintf(sp,
+ net_buf + sizeof net_buf - sp,
+ " mask=%#x ? ",mask);
mask = 0;
} else if (mask + dmask == 0) {
for (i = 0;
(i != 32 && ((1<<i)&mask) == 0);
i++)
continue;
- sprintf(sp, "/%d",32-i);
+ snprintf(sp,
+ net_buf + sizeof net_buf - sp,
+ "/%d",32-i);
} else
- sprintf(sp," (mask %#x)", mask);
+ snprintf(sp,
+ net_buf + sizeof net_buf - sp,
+ " (mask %#x)", mask);
}
if (!nflag) {