summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/udp.c
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>2002-01-03 16:27:42 +0000
committerHakan Olsson <ho@cvs.openbsd.org>2002-01-03 16:27:42 +0000
commit4489c1820c489738cc69b3d150d036f405ed8a14 (patch)
tree485b5f0d859ad04ce1f4576b23676aa7f1be9ad9 /sbin/isakmpd/udp.c
parent3c1bd46556c17c2cdb2c0f3a8c593614e6864150 (diff)
str[n]{cpy,cat} -> strl{cpy,cat}, sprintf -> snprintf
Diffstat (limited to 'sbin/isakmpd/udp.c')
-rw-r--r--sbin/isakmpd/udp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sbin/isakmpd/udp.c b/sbin/isakmpd/udp.c
index 30611d4fa8a..5d9b7871f6c 100644
--- a/sbin/isakmpd/udp.c
+++ b/sbin/isakmpd/udp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp.c,v 1.53 2001/10/26 13:29:26 ho Exp $ */
+/* $OpenBSD: udp.c,v 1.54 2002/01/03 16:27:41 ho Exp $ */
/* $EOM: udp.c,v 1.57 2001/01/26 10:09:57 niklas Exp $ */
/*
@@ -351,7 +351,7 @@ udp_bind_if (char *ifname, struct sockaddr *if_addr, void *arg)
if_addr->sa_family);
return;
}
- strncpy (flags_ifr.ifr_name, ifname, sizeof flags_ifr.ifr_name - 1);
+ strlcpy (flags_ifr.ifr_name, ifname, sizeof flags_ifr.ifr_name);
if (ioctl (s, SIOCGIFFLAGS, (caddr_t)&flags_ifr) == -1)
{
log_error ("udp_bind_if: ioctl (%d, SIOCGIFFLAGS, ...) failed", s);
@@ -818,7 +818,7 @@ udp_decode_ids (struct transport *t)
idsrc, sizeof idsrc, NULL, 0, NI_NUMERICHOST) != 0)
{
log_print ("udp_decode_ids: getnameinfo () failed for 'src'");
- strcpy (idsrc, "<error>");
+ strlcpy (idsrc, "<error>", 256);
}
if (getnameinfo (((struct udp_transport *)t)->dst,
@@ -826,14 +826,14 @@ udp_decode_ids (struct transport *t)
iddst, sizeof iddst, NULL, 0, NI_NUMERICHOST) != 0)
{
log_print ("udp_decode_ids: getnameinfo () failed for 'dst'");
- strcpy (iddst, "<error>");
+ strlcpy (iddst, "<error>", 256);
}
#else
- strcpy (idsrc, inet_ntoa (((struct udp_transport *)t)->src.sin_addr));
- strcpy (iddst, inet_ntoa (((struct udp_transport *)t)->dst.sin_addr));
+ strlcpy (idsrc, inet_ntoa (((struct udp_transport *)t)->src.sin_addr), 256);
+ strlcpy (iddst, inet_ntoa (((struct udp_transport *)t)->dst.sin_addr), 256);
#endif /* HAVE_GETNAMEINFO */
- sprintf (result, "src: %s dst: %s", idsrc, iddst);
+ snprintf (result, 1024, "src: %s dst: %s", idsrc, iddst);
return result;
}