Commit ae2221362f68e167b9f3fdb0132bf339c40483de

Nika Layzell 2018-03-17T02:33:48

mailmap: Some more style cleanup

diff --git a/src/mailmap.c b/src/mailmap.c
index 9e4d574..4a073a2 100644
--- a/src/mailmap.c
+++ b/src/mailmap.c
@@ -246,7 +246,7 @@ void git_mailmap_resolve(
 	}
 }
 
-git_mailmap_entry* git_mailmap_entry_lookup(
+git_mailmap_entry *git_mailmap_entry_lookup(
 	git_mailmap *mailmap,
 	const char *name,
 	const char *email)
@@ -265,9 +265,12 @@ git_mailmap_entry* git_mailmap_entry_lookup(
 	return NULL;
 }
 
-git_mailmap_entry* git_mailmap_entry_byindex(git_mailmap *mailmap, size_t idx)
+git_mailmap_entry *git_mailmap_entry_byindex(git_mailmap *mailmap, size_t idx)
 {
-	return git_vector_get(&mailmap->entries, idx);
+	if (idx < git_vector_length(&mailmap->entries))
+		return git_vector_get(&mailmap->entries, idx);
+
+	return NULL;
 }
 
 size_t git_mailmap_entry_count(git_mailmap *mailmap)