Commit 277c85eb by Edward Thomson

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

parent f0224772
...@@ -53,7 +53,7 @@ static void expect_iterator_items( ...@@ -53,7 +53,7 @@ static void expect_iterator_items(
cl_assert(entry->mode != GIT_FILEMODE_TREE); cl_assert(entry->mode != GIT_FILEMODE_TREE);
} }
if (++count > expected_flat) if (++count >= expected_flat)
break; break;
} }
...@@ -99,7 +99,7 @@ static void expect_iterator_items( ...@@ -99,7 +99,7 @@ static void expect_iterator_items(
cl_assert(!error || error == GIT_ITEROVER); cl_assert(!error || error == GIT_ITEROVER);
} }
if (++count > expected_total) if (++count >= expected_total)
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment