diff --git a/src/xpdev/ini_file.c b/src/xpdev/ini_file.c
index 7cb4aeab9fb116c0c840e00b484d9de6d8a8f8e0..a189e1ea28d1abc45673070ebcd7b5cfe17a2070 100644
--- a/src/xpdev/ini_file.c
+++ b/src/xpdev/ini_file.c
@@ -1021,9 +1021,9 @@ char* iniReadSString(FILE* fp, const char* section, const char* key, const char*
 
 	ret = iniReadString(fp, section, key, deflt, fval);
 	if (ret == NULL)
-		return ret;
+		return NULL;
 	if (ret == deflt)
-		return ret;
+		return deflt;
 	if (sz < 1 || value == NULL)
 		return value;
 	for (pos = 0; ret[pos]; pos++) {
@@ -1068,9 +1068,9 @@ char* iniGetSString(str_list_t list, const char* section, const char* key, const
 
 	ret = iniGetString(list, section, key, deflt, fval);
 	if (ret == NULL)
-		return ret;
+		return NULL;
 	if (ret == deflt)
-		return ret;
+		return deflt;
 	if (sz < 1 || value == NULL)
 		return value;
 	for (pos = 0; ret[pos]; pos++) {