diff --git a/dist/wcpatch/src/main.cpp b/dist/wcpatch/src/main.cpp index 09d96ae..4785572 100644 --- a/dist/wcpatch/src/main.cpp +++ b/dist/wcpatch/src/main.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -401,7 +402,16 @@ bool apply_dif(stdext::multi_ref file_data, ui seekable.seek(stdext::seek_from::begin, offset); auto value = stream.read(); if (value != original_value) + { + unsigned file_b = std::to_integer(value); + unsigned expect_b = std::to_integer(original_value); + unsigned repl_b = std::to_integer(replacement_value); + std::cerr << "apply_dif: mismatch at offset 0x" << std::hex << offset + << ": file=0x" << std::setw(2) << std::setfill('0') << file_b + << " expected=0x" << std::setw(2) << expect_b + << " replace=0x" << std::setw(2) << repl_b << std::dec << "\n"; return false; + } seekable.seek(stdext::seek_from::current, -1); stream.write(replacement_value); }