1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-26 04:17:33 +00:00

Bugfix: crash when apcupsd isnt running

This commit is contained in:
Nikolas Garofil 2009-11-16 20:19:57 +01:00
parent a1ddcc0786
commit 90f5701f3e

View File

@ -181,7 +181,7 @@ void update_apcupsd(void) {
break; break;
} }
#ifdef HAVE_GETHOSTBYNAME_R #ifdef HAVE_GETHOSTBYNAME_R
if (gethostbyname_r(info.apcupsd.host, &he_mem, hostbuff, sizeof(hostbuff), &he, &he_errno)) { if (gethostbyname_r(info.apcupsd.host, &he_mem, hostbuff, sizeof(hostbuff), &he, &he_errno) || !he ) {
NORM_ERR("APCUPSD gethostbyname_r: %s", hstrerror(h_errno)); NORM_ERR("APCUPSD gethostbyname_r: %s", hstrerror(h_errno));
break; break;
} }