[PATCH] fix uninitialized variables in common/comments.c

Olaf Hering olh at suse.de
Fri Sep 8 10:47:30 CEST 2006


../common/comments.c: In function 'delete_service_comment':
../common/comments.c:257: warning: 'result' is used uninitialized in this function
../common/comments.c: In function 'delete_host_comment':
../common/comments.c:245: warning: 'result' is used uninitialized in this function

---
 common/comments.c |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

Index: nagios-2.5/common/comments.c
===================================================================
--- nagios-2.5.orig/common/comments.c
+++ nagios-2.5/common/comments.c
@@ -237,24 +237,16 @@ int delete_comment(int type, unsigned lo
 
 /* deletes a host comment */
 int delete_host_comment(unsigned long comment_id){
-	int result;
-
 	/* delete the comment from memory */
-	delete_comment(HOST_COMMENT,comment_id);
-	
-	return result;
+	return delete_comment(HOST_COMMENT,comment_id);
         }
 
 
 
 /* deletes a service comment */
 int delete_service_comment(unsigned long comment_id){
-	int result;
-	
 	/* delete the comment from memory */
-	delete_comment(SERVICE_COMMENT,comment_id);
-	
-	return result;
+	return delete_comment(SERVICE_COMMENT,comment_id);
         }
 
 

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