Merge pull request #2 from dron0gus/fragments-fix

fragments: if offset is bigger or EQUAL to current fragment size - sk…
This commit is contained in:
rusefillc 2022-12-21 08:28:09 -05:00 committed by GitHub
commit 948d5820f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ void copyRange(uint8_t* destination, FragmentList src, size_t skip, size_t size)
size_t fragmentIndex = 0;
// Find which fragment to start - skip any full fragments smaller than `skip` parameter
while (fragmentIndex < src.count && skip > src.fragments[fragmentIndex].size) {
while (fragmentIndex < src.count && skip >= src.fragments[fragmentIndex].size) {
skip -= src.fragments[fragmentIndex].size;
fragmentIndex++;
}