summaryrefslogtreecommitdiffstats
path: root/applypatch/bspatch.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-03-28 21:11:11 +0200
committerandroid-build-merger <android-build-merger@google.com>2017-03-28 21:11:11 +0200
commit862b7e8523800e638eb1230680c30ebad2f6e5c8 (patch)
treea917dd3d7eeb25c00acdb7d96a417dd2c13a0288 /applypatch/bspatch.cpp
parentapplypatch: Change the ssize_t length parameters to size_t. (diff)
parentMerge changes from topic 'sinkfn' (diff)
downloadandroid_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.tar
android_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.tar.gz
android_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.tar.bz2
android_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.tar.lz
android_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.tar.xz
android_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.tar.zst
android_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.zip
Diffstat (limited to 'applypatch/bspatch.cpp')
-rw-r--r--applypatch/bspatch.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/applypatch/bspatch.cpp b/applypatch/bspatch.cpp
index 8ef7a068d..f75a2c680 100644
--- a/applypatch/bspatch.cpp
+++ b/applypatch/bspatch.cpp
@@ -24,9 +24,9 @@
#include <sys/types.h>
#include <bspatch.h>
+#include <openssl/sha.h>
#include "applypatch/applypatch.h"
-#include "openssl/sha.h"
void ShowBSDiffLicense() {
puts("The bsdiff library used herein is:\n"
@@ -61,9 +61,9 @@ void ShowBSDiffLicense() {
}
int ApplyBSDiffPatch(const unsigned char* old_data, size_t old_size, const Value* patch,
- size_t patch_offset, SinkFn sink, void* token, SHA_CTX* ctx) {
- auto sha_sink = [&](const uint8_t* data, size_t len) {
- len = sink(data, len, token);
+ size_t patch_offset, SinkFn sink, SHA_CTX* ctx) {
+ auto sha_sink = [&sink, &ctx](const uint8_t* data, size_t len) {
+ len = sink(data, len);
if (ctx) SHA1_Update(ctx, data, len);
return len;
};