When loading bad memory addresses from a file, we are passed an end pointer that points on the first byte after the buffer. We want the buffer to be null-terminated (by changing the last byte to \0 if it is reasonable to do so), so adjust the end pointer to be on that byte.
In case the last byte cannot be changed safely, improve the diagnostic message to help the user figure out how to fix their config.