summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-03-02 15:38:13 -0500
committerEdward Thomson <ethomson@github.com>2016-03-23 17:08:37 -0400
commit277c85eb1c54804ab503ade69be058a0afd426f4 (patch)
treed2ff73dce9c6deea1cc316cedb41ba4f37bae303
parentf0224772ee4300d55e11ab6f84cb3dd64b35ecfd (diff)
downloadlibgit2-277c85eb1c54804ab503ade69be058a0afd426f4.tar.gz
repo::iterator: don't go out of bounds
-rw-r--r--tests/repo/iterator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/repo/iterator.c b/tests/repo/iterator.c
index 5e5e4b551..0ab8d68c0 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;
}