Use safe_strcpy() instead of strncpy(); it guarantees null termination

This commit is contained in:
David Anderson 2020-04-20 20:11:14 -07:00
parent 1fceef042e
commit 01e02d2c93
1 changed files with 1 additions and 1 deletions

View File

@ -97,7 +97,7 @@ int HOST_INFO::get_local_network_info() {
}
#endif
if (!cc_config.device_name.empty()) {
strncpy(domain_name, cc_config.device_name.c_str(), sizeof(domain_name)-1);
safe_strcpy(domain_name, cc_config.device_name.c_str());
}
return 0;
}