Fix for patch_inplace when the resulting file is smaller than before; truncation was needed.