project_files/frontlib/util/inihelper.c
changeset 7230 240620f46dd7
parent 7227 1c859f572d72
child 7314 6171f0bad318
--- a/project_files/frontlib/util/inihelper.c	Tue Jun 12 21:10:11 2012 +0200
+++ b/project_files/frontlib/util/inihelper.c	Fri Jun 15 19:57:25 2012 +0200
@@ -179,7 +179,7 @@
 			value = def;
 		}
 		char *valueDup = flib_strdupnull(value);
-		if(valueDup) {
+		if(valueDup || !def) {
 			*outVar = valueDup;
 			result = 0;
 		}
@@ -209,7 +209,7 @@
 	int result = flib_ini_get_int(ini, &tmpValue, key);
 	if(result == 0) {
 		*outVar = tmpValue;
-	} else if(result == INI_ERROR_NOTFOUND) {
+	} else if(result == INI_ERROR_NOTFOUND || result == INI_ERROR_FORMAT) {
 		*outVar = def;
 		result = 0;
 	}
@@ -238,7 +238,7 @@
 	int result = flib_ini_get_bool(ini, &tmpValue, key);
 	if(result == 0) {
 		*outVar = tmpValue;
-	} else if(result == INI_ERROR_NOTFOUND) {
+	} else if(result == INI_ERROR_NOTFOUND || result == INI_ERROR_FORMAT) {
 		*outVar = def;
 		result = 0;
 	}