diff options
author | delphij <delphij@FreeBSD.org> | 2009-02-21 03:38:46 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2009-02-21 03:38:46 +0000 |
commit | e4bc0b9b5b632f8e560b81156f5e37d84f798139 (patch) | |
tree | 977b9b204af7139fda89933babe5af276182ca5d /usr.bin/talk | |
parent | b1620f0ed95f431f5b0b921f845340b5c722d953 (diff) | |
download | FreeBSD-src-e4bc0b9b5b632f8e560b81156f5e37d84f798139.zip FreeBSD-src-e4bc0b9b5b632f8e560b81156f5e37d84f798139.tar.gz |
Utilize strlcpy().
Diffstat (limited to 'usr.bin/talk')
-rw-r--r-- | usr.bin/talk/get_names.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.bin/talk/get_names.c b/usr.bin/talk/get_names.c index 25f4673..b3e0f7b 100644 --- a/usr.bin/talk/get_names.c +++ b/usr.bin/talk/get_names.c @@ -113,10 +113,7 @@ get_names(int argc, char *argv[]) msg.addr.sa_family = htons(AF_INET); msg.ctl_addr.sa_family = htons(AF_INET); msg.id_num = htonl(0); - strncpy(msg.l_name, my_name, NAME_SIZE); - msg.l_name[NAME_SIZE - 1] = '\0'; - strncpy(msg.r_name, his_name, NAME_SIZE); - msg.r_name[NAME_SIZE - 1] = '\0'; - strncpy(msg.r_tty, his_tty, TTY_SIZE); - msg.r_tty[TTY_SIZE - 1] = '\0'; + strlcpy(msg.l_name, my_name, NAME_SIZE); + strlcpy(msg.r_name, his_name, NAME_SIZE); + strlcpy(msg.r_tty, his_tty, TTY_SIZE); } |