summaryrefslogtreecommitdiff
path: root/syspatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'syspatch.c')
-rw-r--r--syspatch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/syspatch.c b/syspatch.c
index a90e031..3b7b24c 100644
--- a/syspatch.c
+++ b/syspatch.c
@@ -196,10 +196,12 @@ static int advance_target_buffer(xd3_stream *stream, MapState *target_state) {
if (tgt->length) {
if (write_target(tgt, target_state) != 0)
return -1;
- TARGET_WINDOWS_WRITTEN += 1;
}
if (stream_to_target_write(stream, tgt) != 0)
return -1;
+ if (tgt->length) {
+ TARGET_WINDOWS_WRITTEN += 1;
+ }
return 0;
}