summaryrefslogtreecommitdiffstats
path: root/usr.bin/tftp/main.c
diff options
context:
space:
mode:
authorgsoares <gsoares@openbsd.org>2012-05-02 13:41:15 +0000
committergsoares <gsoares@openbsd.org>2012-05-02 13:41:15 +0000
commitd71bf98d7ff498143f4f69a41ec557e1d3a4ba81 (patch)
tree0b3c739b7fc27a6842f888790a59d6bfb77de00b /usr.bin/tftp/main.c
parentdon't call getifmtu in -n mode, assume 1500. calling getifmtu requires (diff)
downloadwireguard-openbsd-d71bf98d7ff498143f4f69a41ec557e1d3a4ba81.tar.xz
wireguard-openbsd-d71bf98d7ff498143f4f69a41ec557e1d3a4ba81.zip
strncpy() -> strlcpy()
ok henning@
Diffstat (limited to 'usr.bin/tftp/main.c')
-rw-r--r--usr.bin/tftp/main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index 5df3dfa8df6..ba9d854e55b 100644
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.31 2012/05/01 04:23:21 gsoares Exp $ */
+/* $OpenBSD: main.c,v 1.32 2012/05/02 13:41:15 gsoares Exp $ */
/* $NetBSD: main.c,v 1.6 1995/05/21 16:54:10 mycroft Exp $ */
/*
@@ -246,11 +246,10 @@ setpeer(char *host, char *port)
/* res->ai_addr <= sizeof(peeraddr) is guaranteed */
memcpy(&peeraddr, res->ai_addr, res->ai_addrlen);
if (res->ai_canonname) {
- (void) strncpy(hostname, res->ai_canonname,
- sizeof(hostname));
+ (void)strlcpy(hostname, res->ai_canonname,
+ sizeof(hostname));
} else
- (void) strncpy(hostname, host, sizeof(hostname));
- hostname[sizeof(hostname)-1] = 0;
+ (void)strlcpy(hostname, host, sizeof(hostname));
connected = 1;
}
freeaddrinfo(res0);