diff options
author | Gleydson Soares <gsoares@cvs.openbsd.org> | 2012-05-02 13:41:16 +0000 |
---|---|---|
committer | Gleydson Soares <gsoares@cvs.openbsd.org> | 2012-05-02 13:41:16 +0000 |
commit | 230968293de418579cf453f0724d6d1dc7360e13 (patch) | |
tree | 5c74903ba6011c646e3f7f8e7d327f9453245159 | |
parent | 8111b0b6471475896e601dc2d30bffe9cbb753a2 (diff) |
strncpy() -> strlcpy()
ok henning@
-rw-r--r-- | usr.bin/tftp/main.c | 9 |
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); |