Check if ip_address string is non-empty

master
Avinash Sonawane 2021-03-23 13:10:20 +05:30
parent c22bdad624
commit 509b2c5ca5
1 changed files with 1 additions and 1 deletions

View File

@ -217,7 +217,7 @@ char* get_ip_address(netdata* data)
struct sockaddr_in *p_sa; struct sockaddr_in *p_sa;
/* use cached value if possible and if the update count is non-zero */ /* use cached value if possible and if the update count is non-zero */
if (data->ip_address && data->ip_update_count > 0) if (data->ip_address[0] && data->ip_update_count > 0)
{ {
data->ip_update_count--; data->ip_update_count--;
return data->ip_address; return data->ip_address;