X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/654175798bdbdd6403e10c8fa74e8586b3612ea1..17d31b380b7c748837b30e7e0c54ab17974f7ab6:/socket.c diff --git a/socket.c b/socket.c index 6fd4e365..e7e98a69 100644 --- a/socket.c +++ b/socket.c @@ -67,7 +67,7 @@ static int open_socket_in(int type, int port) { struct hostent *hp; struct sockaddr_in sock; - char host_name[200]; + char host_name[MAXHOSTNAMELEN]; int res; int one=1; @@ -330,7 +330,7 @@ char *client_addr(int fd) exit_cleanup(RERR_SOCKETIO); } - strlcpy(addr_buf,(char *)inet_ntoa(sockin->sin_addr), sizeof(addr_buf)-1); + strlcpy(addr_buf,(char *)inet_ntoa(sockin->sin_addr), sizeof(addr_buf)); return addr_buf; } @@ -363,7 +363,7 @@ char *client_name(int fd) if ((hp = gethostbyaddr((char *) &sockin->sin_addr, sizeof(sockin->sin_addr), AF_INET))) { - strlcpy(name_buf,(char *)hp->h_name,sizeof(name_buf) - 1); + strlcpy(name_buf,(char *)hp->h_name,sizeof(name_buf)); }