project_files/frontlib/util/inihelper.c
changeset 7467 a9ab8067a2d1
parent 7316 f7b49b2c5d84
child 10017 de822cd3df3a
--- a/project_files/frontlib/util/inihelper.c	Mon Aug 06 22:31:02 2012 +0200
+++ b/project_files/frontlib/util/inihelper.c	Mon Aug 06 22:32:05 2012 +0200
@@ -123,6 +123,7 @@
 	}
 	if(!log_badargs_if2(ini==NULL, section==NULL)) {
 		if(!iniparser_find_entry(ini->inidict, section)) {
+			flib_log_d("Ini section %s not found", section);
 			result = INI_ERROR_NOTFOUND;
 		} else {
 			ini->currentSection = flib_strdupnull(section);
@@ -143,6 +144,7 @@
 		result = flib_ini_enter_section(ini, section);
 		if(result == INI_ERROR_NOTFOUND) {
 			if(iniparser_set(ini->inidict, section, NULL)) {
+				flib_log_e("Error creating ini section %s", section);
 				result = INI_ERROR_OTHER;
 			} else {
 				result = flib_ini_enter_section(ini, section);
@@ -256,10 +258,13 @@
 
 int flib_ini_set_str(flib_ini *ini, const char *key, const char *value) {
 	int result = INI_ERROR_OTHER;
-	if(log_badargs_if4(ini==NULL, ini->currentSection==NULL, key==NULL, value==NULL)) {
+	if(!log_badargs_if4(ini==NULL, ini->currentSection==NULL, key==NULL, value==NULL)) {
 		char *dictKey = createDictKey(ini->currentSection, key);
 		if(dictKey) {
 			result = iniparser_set(ini->inidict, dictKey, value);
+			if(result) {
+				flib_log_e("Error setting ini entry %s to %s", dictKey, value);
+			}
 		}
 		free(dictKey);
 	}