diff --git a/src/bin/network/telnet/commands.c b/src/bin/network/telnet/commands.c index 257bba6254..5be354892d 100644 --- a/src/bin/network/telnet/commands.c +++ b/src/bin/network/telnet/commands.c @@ -2271,7 +2271,7 @@ tn(int argc, char *argv[]) hostname = hostp; memset(&su, 0, sizeof su); su.sun_family = AF_UNIX; - strncpy(su.sun_path, hostp, sizeof su.sun_path); + strlcpy(su.sun_path, hostp, sizeof su.sun_path); printf("Trying %s...\n", hostp); net = socket(AF_UNIX, SOCK_STREAM, 0); if ( net < 0) {