Closed Raizo62 closed 4 years ago
if I follow the compiler's advice, and add in cmonwirelessdevice.h :
#include <functional>
The compiler says :
g++ -O4 -Wall -fomit-frame-pointer -o obj/cvwifiguest.o -I/usr/include/libnl3 -lnl-genl-3 -lnl-3 -lpthread -c src/cvwifiguest.cc
In function ‘bool VWifiGuest::get_pmaddr(ether_addr&, const char*)’,
inlined from ‘void VWifiGuest::handle_new_winet_notification(WirelessDevice)’ at src/cvwifiguest.cc:1031:15:
src/cvwifiguest.cc:1095:12: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 16 equals destination size [-Wstringop-truncation]
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/cvwifiguest.cc: In member function ‘bool VWifiGuest::get_pmaddr(ether_addr&, const char*)’:
src/cvwifiguest.cc:1095:12: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 16 equals destination size [-Wstringop-truncation]
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have change "strncpy" by "memcpy"