Commit c716b1878e33d8cecf33e4c2a7b48d51bc88f95e

Vicent Marti 2011-06-17T19:47:58

config: Fix unitialized variable warning

diff --git a/src/config_file.c b/src/config_file.c
index 5199361..0ddda38 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -986,17 +986,16 @@ static int config_write(diskfile_backend *cfg, cvar_t *var)
 					break;
 				}
 			} else {
-				int cmp;
+				int cmp = -1;
 
 				pre_end = cfg->reader.read_ptr;
-				error = parse_variable(cfg, &var_name, &var_value);
-				if (error == GIT_SUCCESS)
+				if ((error = parse_variable(cfg, &var_name, &var_value)) == GIT_SUCCESS)
 					cmp = strcasecmp(var->name, var_name);
 
 				free(var_name);
 				free(var_value);
 
-				if (error < GIT_SUCCESS || cmp)
+				if (cmp != 0)
 					break;
 
 				post_start = cfg->reader.read_ptr;