Commit 21dbc4e
committed
thcrap_tasofro: fill the overallocated part of rep_buffer with zeroes
When we replace a file with a smaller one, we overallocate our rep buffer
because we always give the the game the biggest of the 2 sizes.
But we used to only fill the useful part of the rep buffer with the rep
file, and keep the overallocated part as garbage, which then ends up in the
game's internal buffer.
This is fine for a bunch of file types that have clear end markers, like png
where the header contains the file size or compiled nut scripts which end with
a little endian TAIL tag, but it broke things when replacing plaintext nut
scripts because the nut compiler tried to interpred the garbage at the end as
code.1 parent c2fe3c3 commit 21dbc4e
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
0 commit comments