Fix modern gcc warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source

Silence warning about using src to determine number of bytes to copy.
In this case it doesn't matter whether it is `src` or `dest`. So there
is no functionality change.

Bug: #210 
Fix By: @flyingdutchman23
pull/205/merge
flyingdutchman23 7 years ago committed by Brad House
parent 7ebedab25d
commit 162debf3cc
  1. 2
      ares_init.c

@ -299,7 +299,7 @@ int ares_dup(ares_channel *dest, ares_channel src)
(*dest)->sock_func_cb_data = src->sock_func_cb_data;
strncpy((*dest)->local_dev_name, src->local_dev_name,
sizeof(src->local_dev_name));
sizeof((*dest)->local_dev_name));
(*dest)->local_ip4 = src->local_ip4;
memcpy((*dest)->local_ip6, src->local_ip6, sizeof(src->local_ip6));

Loading…
Cancel
Save