diff options
author | Geremy Condra <gcondra@google.com> | 2014-04-10 15:28:36 -0700 |
---|---|---|
committer | Geremy Condra <gcondra@google.com> | 2014-04-10 15:36:20 -0700 |
commit | 4029ced07661bbe144d290b390cd56406111dbf8 (patch) | |
tree | b3365160cafd1c9ea96514cbf0ca34255a2f0101 | |
parent | ce63e8fd12df8bb8c1e5ac7136d0c28b2a8d38ad (diff) | |
download | syspatch-4029ced07661bbe144d290b390cd56406111dbf8.tar.gz |
Increment TARGET_WINDOWS_WRITTEN after stream_to_target_write.l-preview
Prior to this, TARGET_WINDOWS_WRITTEN would be incremented before
the call to stream_to_target_write if the target was nonzero size
and write_target succeeded. This caused tgt->start to be set
incorrectly. This confused mapio but not xdelta, leading to
correct target windows written to incorrect locations.
Change-Id: I76db5281a749a20d0e63b8126238eb1886d87a1c
-rw-r--r-- | syspatch.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; } |