Fix multi-page write calculation for how many bytes need to be written on each page.
Also fix a small typo in the comment.
When pageNumber2 is not the next page the calculation returns a value higher than the page size. Instead, use pageNumber1 end and substract the number of bytes already written to that page.
I made this little python scratch file to show the difference before and after the fix:
Fix multi-page write calculation for how many bytes need to be written on each page. Also fix a small typo in the comment.
When pageNumber2 is not the next page the calculation returns a value higher than the page size. Instead, use pageNumber1 end and substract the number of bytes already written to that page.
I made this little python scratch file to show the difference before and after the fix:
Output: