WerWolv / ImHex

🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
https://imhex.werwolv.net
GNU General Public License v2.0
37.45k stars 1.64k forks source link

Fix off by one in "Export selection to file" #1774

Closed FireNX70 closed 4 days ago

FireNX70 commented 4 days ago

Problem description

Export selection to file would never finish and wouldn't export the last byte.

Implementation description

It was just a simple off by one when using the selection's end address to calculate the remaining data size. Add one to the remaining size calculation.

Additional things

Fixes https://github.com/WerWolv/ImHex/issues/1733, https://github.com/WerWolv/ImHex/issues/1619 and https://github.com/WerWolv/ImHex/issues/1597.

WerWolv commented 4 days ago

Thank you!