1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-29 21:49:07 +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;
}
#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));
break;
}