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

Dr. Dave Blunt dblunt at itgroundwork.com
Thu May 19 02:02:49 CEST 2005


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",(unsigned
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",(unsigned
long)hst->last_check);

            macro_x[MACRO_LASTHOSTCHECK][MAX_DATETIME_LENGTH-1]='\x0';

              }

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20050518/24316573/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utils.c.patch
Type: application/octet-stream
Size: 718 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20050518/24316573/attachment.obj>


More information about the Developers mailing list