From 1e0941f4f63d5ee56ad42aa3aa47eb6a8a155077 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 10 Nov 2017 11:49:53 -0800 Subject: applypatch: Change the patch parameter to const Value& in Apply{BSDiff,Image}Patch. It used to be "const Value*", but nullptr won't be a valid input. Test: recovery_host_test; recovery_component_test Change-Id: I904b5689ac3e64504088bf0544c9fb5d45a52243 --- updater/blockimg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'updater/blockimg.cpp') diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp index 1c931afef..08f9930ea 100644 --- a/updater/blockimg.cpp +++ b/updater/blockimg.cpp @@ -1318,7 +1318,7 @@ static int PerformCommandDiff(CommandParameters& params) { RangeSinkWriter writer(params.fd, tgt); if (params.cmdname[0] == 'i') { // imgdiff - if (ApplyImagePatch(params.buffer.data(), blocks * BLOCKSIZE, &patch_value, + if (ApplyImagePatch(params.buffer.data(), blocks * BLOCKSIZE, patch_value, std::bind(&RangeSinkWriter::Write, &writer, std::placeholders::_1, std::placeholders::_2), nullptr, nullptr) != 0) { @@ -1327,7 +1327,7 @@ static int PerformCommandDiff(CommandParameters& params) { return -1; } } else { - if (ApplyBSDiffPatch(params.buffer.data(), blocks * BLOCKSIZE, &patch_value, 0, + if (ApplyBSDiffPatch(params.buffer.data(), blocks * BLOCKSIZE, patch_value, 0, std::bind(&RangeSinkWriter::Write, &writer, std::placeholders::_1, std::placeholders::_2), nullptr) != 0) { -- cgit v1.2.3