3035. [cleanup] Simplify by using strlcpy. [RT #22521]

This commit is contained in:
Mark Andrews 2011-02-21 07:34:57 +00:00
parent 0a92db42c6
commit c12904ec53
3 changed files with 8 additions and 8 deletions

View file

@ -1,3 +1,5 @@
3035. [cleanup] Simplify by using strlcpy. [RT #22521]
3034. [cleanup] nslookup: use strlcpy instead of safecopy. [RT #22521]
3033. [cleanup] Add two INSIST(bucket != DNS_ADB_INVALIDBUCKET).

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dighost.c,v 1.336 2010/12/09 00:54:33 marka Exp $ */
/* $Id: dighost.c,v 1.337 2011/02/21 07:34:56 marka Exp $ */
/*! \file
* \note
@ -566,10 +566,8 @@ make_server(const char *servname, const char *userarg) {
if (srv == NULL)
fatal("memory allocation failure in %s:%d",
__FILE__, __LINE__);
strncpy(srv->servername, servname, MXNAME);
strncpy(srv->userarg, userarg, MXNAME);
srv->servername[MXNAME-1] = 0;
srv->userarg[MXNAME-1] = 0;
strlcpy(srv->servername, servname, MXNAME);
strlcpy(srv->userarg, userarg, MXNAME);
ISC_LINK_INIT(srv, link);
return (srv);
}

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: host.c,v 1.124 2010/11/16 05:38:30 marka Exp $ */
/* $Id: host.c,v 1.125 2011/02/21 07:34:57 marka Exp $ */
/*! \file */
@ -824,8 +824,8 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
if (isc_commandline_index >= argc)
show_usage();
strncpy(hostname, argv[isc_commandline_index], sizeof(hostname));
hostname[sizeof(hostname)-1]=0;
strlcpy(hostname, argv[isc_commandline_index], sizeof(hostname));
if (argc > isc_commandline_index + 1) {
set_nameserver(argv[isc_commandline_index+1]);
debug("server is %s", argv[isc_commandline_index+1]);