New to cppcheck. Couldn't figure out how to solve this issue (cppcheck warning). any help would be appreciated.
if (!call_initialized)
{ char id1[16];
char id1[16];
char* dummy_char_ptr = inet_ntoa(*((in_addr*)&source_ip));
std::strncpy(id1, dummy_char_ptr, 16);
dummy_char_ptr=inet_ntoa(*((in_addr*)&destination_ip));
std::strncpy(id2, dummy_char_ptr, 16);
dummy_char_ptr=NULL;
std::cerr << id1 << " -----> " << id2 << std::endl;
return 0;
}
error(warning) - The buffer 'id2' may not be zero-terminated after the call to strncpy().