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

This commit is contained in:
Edward Thomson 2016-03-02 15:38:13 -05:00
parent f0224772ee
commit 277c85eb1c

View File

@ -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;
}