Page 1 of 1

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

Posted: Fri Sep 08, 2006 1:16 am
by Guest

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){





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]