[PATCH] fix uninitialized variables in cgi/extinfo.c

Olaf Hering olh at suse.de
Fri Sep 8 11:16:51 CEST 2006


extinfo.c: In function 'compare_sortdata_entries':
extinfo.c:2901: warning: 'current_attempt[0]' is used uninitialized in this function
extinfo.c:2901: warning: 'current_attempt[1]' is used uninitialized in this function

---
 cgi/extinfo.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: nagios-2.5/cgi/extinfo.c
===================================================================
--- nagios-2.5.orig/cgi/extinfo.c
+++ nagios-2.5/cgi/extinfo.c
@@ -2910,6 +2910,7 @@ int compare_sortdata_entries(int s_type,
 		status[0]=temp_svcstatus->status;
 		host_name[0]=temp_svcstatus->host_name;
 		service_description[0]=temp_svcstatus->description;
+		current_attempt[0]=temp_svcstatus->current_attempt;
 	        }
 	else{
 		temp_hststatus=new_sortdata->hststatus;
@@ -2918,6 +2919,7 @@ int compare_sortdata_entries(int s_type,
 		status[0]=temp_hststatus->status;
 		host_name[0]=temp_hststatus->host_name;
 		service_description[0]="";
+		current_attempt[0]=temp_hststatus->current_attempt;
 	        }
 	if(temp_sortdata->is_service==TRUE){
 		temp_svcstatus=temp_sortdata->svcstatus;
@@ -2926,6 +2928,7 @@ int compare_sortdata_entries(int s_type,
 		status[1]=temp_svcstatus->status;
 		host_name[1]=temp_svcstatus->host_name;
 		service_description[1]=temp_svcstatus->description;
+		current_attempt[1]=temp_svcstatus->current_attempt;
 	        }
 	else{
 		temp_hststatus=temp_sortdata->hststatus;
@@ -2934,6 +2937,7 @@ int compare_sortdata_entries(int s_type,
 		status[1]=temp_hststatus->status;
 		host_name[1]=temp_hststatus->host_name;
 		service_description[1]="";
+		current_attempt[1]=temp_hststatus->current_attempt;
 	        }
 
 	if(s_type==SORT_ASCENDING){

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Developers mailing list