[icinga-checkins] icinga.org: icinga-core/test/core: idoutils: fix small compiler issues #2620

git at icinga.org git at icinga.org
Tue Jun 12 17:56:44 CEST 2012


Module: icinga-core
Branch: test/core
Commit: 1cda0b30a56632c2f934abeef640f5431a0ca17d
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=1cda0b30a56632c2f934abeef640f5431a0ca17d

Author: Thomas Dressler <tdressler at tdressler.net>
Date:   Wed May 30 21:17:45 2012 +0200

idoutils: fix small compiler issues #2620
refs #2620

Conflicts:

	module/idoutils/src/db.c

history below was broken on the cherry-pick, so resolved it for a bugfix
release.

---

 module/idoutils/src/db.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/module/idoutils/src/db.c b/module/idoutils/src/db.c
index 442ee50..e5c5371 100644
--- a/module/idoutils/src/db.c
+++ b/module/idoutils/src/db.c
@@ -1310,16 +1310,19 @@ int ido2db_db_disconnect(ido2db_idi *idi) {
 int ido2db_db_version_check(ido2db_idi *idi) {
 	char *buf;
 	char *name;
+	int result;;
+	void *data[1];
 	/*
 	#ifdef USE_ORACLE
 		char *dbversion;
 		dbversion=NULL;
 	#endif
 	*/
-	void *data[1];
+
 	buf = NULL;
 	name = NULL;
-	int result = IDO_OK;
+	result= IDO_OK;
+
 
 	ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_db_version_check () start \n");
 
@@ -2348,6 +2351,10 @@ char *ido2db_db_escape_string(ido2db_idi *idi, char *buf) {
 
 	ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_db_escape_string('%s') start\n", buf);
 
+	/* init variables to make compilers happy */
+	x=0;
+	y=0;
+
 	z = strlen(buf);
 	if ((newbuf = (char *) malloc((z * 2) + 1)) == NULL) {
 		ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_db_escape_string('%s') Error: memory allocation failed \n", buf);





More information about the icinga-checkins mailing list