Commit 277c85eb1c54804ab503ade69be058a0afd426f4

Edward Thomson 2016-03-02T15:38:13

repo::iterator: don't go out of bounds

diff --git a/tests/repo/iterator.c b/tests/repo/iterator.c
index 5e5e4b5..0ab8d68 100644
--- a/tests/repo/iterator.c
+++ b/tests/repo/iterator.c
@@ -53,7 +53,7 @@ static void expect_iterator_items(
 				cl_assert(entry->mode != GIT_FILEMODE_TREE);
 		}
 
-		if (++count > expected_flat)
+		if (++count >= expected_flat)
 			break;
 	}
 
@@ -99,7 +99,7 @@ static void expect_iterator_items(
 			cl_assert(!error || error == GIT_ITEROVER);
 		}
 
-		if (++count > expected_total)
+		if (++count >= expected_total)
 			break;
 	}