summaryrefslogtreecommitdiffstats
path: root/zcmp.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:29:40 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:29:40 +0000
commit57d1e4420d7f7981a5e55ad5f66cb1534af30851 (patch)
tree7de98d0106a3940da1e3c5eb773d5a1de186a905 /zcmp.cc
parentAdding upstream version 1.1. (diff)
downloadzutils-57d1e4420d7f7981a5e55ad5f66cb1534af30851.tar.xz
zutils-57d1e4420d7f7981a5e55ad5f66cb1534af30851.zip
Adding upstream version 1.2~pre2.upstream/1.2_pre2
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'zcmp.cc')
-rw-r--r--zcmp.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/zcmp.cc b/zcmp.cc
index 8f362c3..3522329 100644
--- a/zcmp.cc
+++ b/zcmp.cc
@@ -246,12 +246,12 @@ int cmp( const long long max_size, const int infd[2],
}
}
- buffer0[rd[0]] = ~buffer1[rd[0]]; // sentinels for the block compare
- buffer1[rd[1]] = ~buffer0[rd[1]];
+ const int min_rd = std::min( rd[0], rd[1] );
+ buffer0[min_rd] = 0; // sentinels for the block compare
+ buffer1[min_rd] = 1;
int first_diff = block_compare( buffer0, buffer1, &line_number );
byte_number += first_diff;
- const int min_rd = std::min( rd[0], rd[1] );
if( first_diff < min_rd )
{