summaryrefslogtreecommitdiffstats
path: root/applypatch/main.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-11-01 22:37:21 +0100
committerandroid-build-merger <android-build-merger@google.com>2016-11-01 22:37:21 +0100
commit2f9b98c99f2363714f3e2684d3279d387992f00e (patch)
tree0c75340e320034812743b58e9a3edbd09768bded /applypatch/main.cpp
parentDO NOT MERGE ANYWHERE init: move healthd to late-init am: 195ff7f79e -s ours am: 7ceb371048 -s ours am: b8c1788e7b -s ours am: 8837b0d25d -s ours am: 3fdf1fd515 -s ours am: 67bc0b9573 -s ours am: 9ab6af5a61 -s ours (diff)
parentMerge "applypatch: Switch the parameter of Value** to std::vector." am: 3f4030e0ef am: bc48de6bf0 (diff)
downloadandroid_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.tar
android_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.tar.gz
android_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.tar.bz2
android_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.tar.lz
android_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.tar.xz
android_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.tar.zst
android_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.zip
Diffstat (limited to 'applypatch/main.cpp')
-rw-r--r--applypatch/main.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/applypatch/main.cpp b/applypatch/main.cpp
index 294f7ee21..988b6f9b1 100644
--- a/applypatch/main.cpp
+++ b/applypatch/main.cpp
@@ -23,9 +23,10 @@
#include <string>
#include <vector>
+#include <openssl/sha.h>
+
#include "applypatch/applypatch.h"
#include "edify/expr.h"
-#include "openssl/sha.h"
static int CheckMode(int argc, char** argv) {
if (argc < 3) {
@@ -129,15 +130,13 @@ static int PatchMode(int argc, char** argv) {
printf("failed to parse patch args\n");
return 1;
}
- std::vector<Value> patches;
- std::vector<Value*> patch_ptrs;
+
+ std::vector<std::unique_ptr<Value>> patches;
for (size_t i = 0; i < files.size(); ++i) {
- patches.push_back(Value(VAL_BLOB,
- std::string(files[i].data.cbegin(), files[i].data.cend())));
- patch_ptrs.push_back(&patches[i]);
+ patches.push_back(std::make_unique<Value>(
+ VAL_BLOB, std::string(files[i].data.cbegin(), files[i].data.cend())));
}
- return applypatch(argv[1], argv[2], argv[3], target_size,
- sha1s, patch_ptrs.data(), &bonus);
+ return applypatch(argv[1], argv[2], argv[3], target_size, sha1s, patches, &bonus);
}
// This program applies binary patches to files in a way that is safe