bug in setting of LASTHOSTCHECK macro (base/utils.c)

Ethan Galstad nagios at nagios.org
Fri May 20 01:15:28 CEST 2005


Thanks!  There was also a bug in the on-demand macro.  Patch will be 
in CVS shortly.

On 18 May 2005 at 17:02, Dr. Dave Blunt wrote:

> 
> Hi,
> 
> The LASTHOSTCHECK macro is being incorrectly set as hst-
> >last_state_change. It should be set as hst->last_check. Patch file 
> is attached for base/utils.c and included inline below.
> 
> Regards,
> 
> 
> Dr. Dave Blunt
> Regional Operations Manager
> GroundWork Open Source Solutions
> 
> 
> *** utils.c Thu Mar 24 17:04:19 2005
> --- modified_utils.c Wed May 18 17:33:45 2005
> ***************
> *** 866,870 ****
>   macro_x[MACRO_LASTHOSTCHECK]=(char 
> *)malloc(MAX_DATETIME_LENGTH);
>   if(macro_x[MACRO_LASTHOSTCHECK]!=NULL){
> !  
> snprintf(macro_x[MACRO_LASTHOSTCHECK],MAX_DATETIME_LENGTH,"%lu",(unsig
> ned long)hst->last_state_change);
>   macro_x[MACRO_LASTHOSTCHECK][MAX_DATETIME_LENGTH-
> 1]='\x0';
>   }
> --- 866,870 ----
>   macro_x[MACRO_LASTHOSTCHECK]=(char 
> *)malloc(MAX_DATETIME_LENGTH);
>   if(macro_x[MACRO_LASTHOSTCHECK]!=NULL){
> !  
> snprintf(macro_x[MACRO_LASTHOSTCHECK],MAX_DATETIME_LENGTH,"%lu",(unsig
> ned long)hst->last_check);
>   macro_x[MACRO_LASTHOSTCHECK][MAX_DATETIME_LENGTH-
> 1]='\x0';
>   }
> 
> 
> 



Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click




More information about the Developers mailing list