As @Ekopalypse said the bigger part of the thread is lost during the transition to the new site.
To make the long story short, I wanted to play a bit with the NUL-ified file contents on sudden reboot / power loss.
There was no need for signing and I couldn’t build it on my own because I don’t have recent Visual Studio but I used the automatic integration (AppVeyor) to help with that.
I made this PR (https://github.com/notepad-plus-plus/notepad-plus-plus/pull/6164) which hopefully fixes the issue.
I don’t think much more can be done without further complications. Just to note that config and session files are still prone to the NUL problem because I didn’t want to introduce changes to TinyXML lib code at this point.
If this PR gets merged only time will tell if the issue if fixed. If it doesn’t appear again a new patch can be made that uses the same Win32 file API to save also the configs and session files (making their saving safer as well).
I would also use that same API to load files removing totally C run-time APIs but let’s make things one step at a time. Otherwise changes will be difficult to review and to get merged.
This topic can be closed / locked.