GideonZ / 1541ultimate

Official GIT archive of 1541 ultimate II sources
GNU General Public License v3.0
173 stars 45 forks source link

Feature request: Ignore 0x00 in Viewer mode to ensure file visualization does not terminate prematurely #355

Open chrisgleissner opened 1 year ago

chrisgleissner commented 1 year ago

Problem Viewer mode interpretes any 0x00 byte in the file to be viewed as a C "end of string" symbol, resulting in premature termination of the rendering. This means that in binary files and in many cases, you'll just see a few characters before a spurious 0x00 is encountered.

Solution Replace any 0x00 (except the last one) with 0x20 (space) before passing the file's content on to the view method. There is no degradation in the user experience because they would not get to see these 0x00 bytes anyway as they result in the termination of the view's rendering.

I noticed this as part of working on #320 and would be happy to implement it if you find it useful.