@ -296,8 +296,8 @@ int ares_dup(ares_channel *dest, ares_channel src)
( * dest ) - > sock_funcs = src - > sock_funcs ;
( * dest ) - > sock_funcs = src - > sock_funcs ;
( * dest ) - > sock_func_cb_data = src - > sock_func_cb_data ;
( * dest ) - > sock_func_cb_data = src - > sock_func_cb_data ;
strn cpy ( ( * dest ) - > local_dev_name , src - > local_dev_name ,
ares_ strcpy( ( * dest ) - > local_dev_name , src - > local_dev_name ,
sizeof ( ( * dest ) - > local_dev_name ) ) ;
sizeof ( ( * dest ) - > local_dev_name ) ) ;
( * dest ) - > local_ip4 = src - > local_ip4 ;
( * dest ) - > local_ip4 = src - > local_ip4 ;
memcpy ( ( * dest ) - > local_ip6 , src - > local_ip6 , sizeof ( src - > local_ip6 ) ) ;
memcpy ( ( * dest ) - > local_ip6 , src - > local_ip6 , sizeof ( src - > local_ip6 ) ) ;
@ -668,14 +668,14 @@ static void commanjoin(char** dst, const char* const src, const size_t len)
size_t newsize ;
size_t newsize ;
/* 1 for terminating 0 and 2 for , and terminating 0 */
/* 1 for terminating 0 and 2 for , and terminating 0 */
newsize = len + ( * dst ? ( strlen ( * dst ) + 2 ) : 1 ) ;
newsize = len + ( * dst ? ( ares_ strlen( * dst ) + 2 ) : 1 ) ;
newbuf = ares_realloc ( * dst , newsize ) ;
newbuf = ares_realloc ( * dst , newsize ) ;
if ( ! newbuf )
if ( ! newbuf )
return ;
return ;
if ( * dst = = NULL )
if ( * dst = = NULL )
* newbuf = ' \0 ' ;
* newbuf = ' \0 ' ;
* dst = newbuf ;
* dst = newbuf ;
if ( strlen ( * dst ) ! = 0 )
if ( ares_ strlen( * dst ) ! = 0 )
strcat ( * dst , " , " ) ;
strcat ( * dst , " , " ) ;
strncat ( * dst , src , len ) ;
strncat ( * dst , src , len ) ;
}
}
@ -687,7 +687,7 @@ static void commanjoin(char** dst, const char* const src, const size_t len)
*/
*/
static void commajoin ( char * * dst , const char * src )
static void commajoin ( char * * dst , const char * src )
{
{
commanjoin ( dst , src , strlen ( src ) ) ;
commanjoin ( dst , src , ares_ strlen( src ) ) ;
}
}
@ -2215,7 +2215,7 @@ static ares_status_t set_options(ares_channel channel, const char *str)
static const char * try_option ( const char * p , const char * q , const char * opt )
static const char * try_option ( const char * p , const char * q , const char * opt )
{
{
size_t len = strlen ( opt ) ;
size_t len = ares_ strlen( opt ) ;
return ( ( size_t ) ( q - p ) > = len & & ! strncmp ( p , opt , len ) ) ? & p [ len ] : NULL ;
return ( ( size_t ) ( q - p ) > = len & & ! strncmp ( p , opt , len ) ) ? & p [ len ] : NULL ;
}
}
@ -2259,7 +2259,7 @@ static char *try_config(char *s, const char *opt, char scc)
/* empty line */
/* empty line */
return NULL ;
return NULL ;
if ( ( len = strlen ( opt ) ) = = 0 )
if ( ( len = ares_ strlen( opt ) ) = = 0 )
/* empty option */
/* empty option */
return NULL ; /* LCOV_EXCL_LINE */
return NULL ; /* LCOV_EXCL_LINE */
@ -2355,8 +2355,8 @@ void ares_set_local_ip6(ares_channel channel,
void ares_set_local_dev ( ares_channel channel ,
void ares_set_local_dev ( ares_channel channel ,
const char * local_dev_name )
const char * local_dev_name )
{
{
strn cpy ( channel - > local_dev_name , local_dev_name ,
ares_ strcpy( channel - > local_dev_name , local_dev_name ,
sizeof ( channel - > local_dev_name ) ) ;
sizeof ( channel - > local_dev_name ) ) ;
channel - > local_dev_name [ sizeof ( channel - > local_dev_name ) - 1 ] = 0 ;
channel - > local_dev_name [ sizeof ( channel - > local_dev_name ) - 1 ] = 0 ;
}
}