Commit 1196807380b73f202bc1fea3045e13b719a465e9

Edward Thomson 2017-01-23T13:29:14

Merge pull request #4087 from tiennou/warnings Fix a few recent warnings

diff --git a/include/git2/tree.h b/include/git2/tree.h
index a38215f..4740b1f 100644
--- a/include/git2/tree.h
+++ b/include/git2/tree.h
@@ -381,7 +381,7 @@ GIT_EXTERN(int) git_treebuilder_write(
  *
  * @see git_treebuilder_write
  *
- * @param id Pointer to store the OID of the newly written tree
+ * @param oid Pointer to store the OID of the newly written tree
  * @param bld Tree builder to write
  * @param tree Shared buffer for writing the tree. Will be grown as necessary.
  * @return 0 or an error code
diff --git a/src/submodule.c b/src/submodule.c
index 21e3d45..e1f59b8 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -349,9 +349,10 @@ done:
 static int submodules_from_index(git_strmap *map, git_index *idx, git_config *cfg)
 {
 	int error;
-	git_iterator *i;
+	git_iterator *i = NULL;
 	const git_index_entry *entry;
 	git_strmap *names = 0;
+
 	git_strmap_alloc(&names);
 	if ((error = load_submodule_names(names, cfg)))
 		goto done;