Menu

#309 The number of pages in the file MZ

v207
open
nobody
None
5
2016-05-25
2016-05-25
Nik
No

incorrect counting pMZ-> e_cp.
if the sizetotal is a multiple of 512, pMZ-> e_sr one less than necessary

for example:
sizetotal | calculated | correct
------------ | --------------- | ------
0 | 0 | 1
2 | 1 | 1
512 | 1 | 2
513 | 2 | 2
1024 | 2 | 3

//bin.c(1638)
pMZ->e_cp      = sizetotal / 512 + (sizetotal % 512 ? 1 : 0); /* pages */

Discussion


Log in to post a comment.