summaryrefslogtreecommitdiffstats
path: root/updater
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-05-07 02:14:06 +0200
committerandroid-build-merger <android-build-merger@google.com>2019-05-07 02:14:06 +0200
commit0d24715223c13917d9399c8c08778eca4e62f886 (patch)
tree81cf24b00af207c2fdb5d329feb32ac9eca1737d /updater
parentMerge "Disable libbootloader_message for darwin" (diff)
parentMerge "Track libziparchive API change." (diff)
downloadandroid_bootable_recovery-0d24715223c13917d9399c8c08778eca4e62f886.tar
android_bootable_recovery-0d24715223c13917d9399c8c08778eca4e62f886.tar.gz
android_bootable_recovery-0d24715223c13917d9399c8c08778eca4e62f886.tar.bz2
android_bootable_recovery-0d24715223c13917d9399c8c08778eca4e62f886.tar.lz
android_bootable_recovery-0d24715223c13917d9399c8c08778eca4e62f886.tar.xz
android_bootable_recovery-0d24715223c13917d9399c8c08778eca4e62f886.tar.zst
android_bootable_recovery-0d24715223c13917d9399c8c08778eca4e62f886.zip
Diffstat (limited to 'updater')
-rw-r--r--updater/blockimg.cpp4
-rw-r--r--updater/install.cpp6
-rw-r--r--updater/updater.cpp3
3 files changed, 5 insertions, 8 deletions
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index 07c3c7b52..b008c28b4 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -1680,7 +1680,7 @@ static Value* PerformBlockImageUpdate(const char* name, State* state,
return StringValue("");
}
- ZipString path_data(patch_data_fn->data.c_str());
+ std::string_view path_data(patch_data_fn->data);
ZipEntry patch_entry;
if (FindEntry(za, path_data, &patch_entry) != 0) {
LOG(ERROR) << name << "(): no file \"" << patch_data_fn->data << "\" in package";
@@ -1688,7 +1688,7 @@ static Value* PerformBlockImageUpdate(const char* name, State* state,
}
params.patch_start = ui->package_zip_addr + patch_entry.offset;
- ZipString new_data(new_data_fn->data.c_str());
+ std::string_view new_data(new_data_fn->data);
ZipEntry new_entry;
if (FindEntry(za, new_data, &new_entry) != 0) {
LOG(ERROR) << name << "(): no file \"" << new_data_fn->data << "\" in package";
diff --git a/updater/install.cpp b/updater/install.cpp
index 8eba64f5d..c30f63960 100644
--- a/updater/install.cpp
+++ b/updater/install.cpp
@@ -130,9 +130,8 @@ Value* PackageExtractFileFn(const char* name, State* state,
const std::string& dest_path = args[1];
ZipArchiveHandle za = static_cast<UpdaterInfo*>(state->cookie)->package_zip;
- ZipString zip_string_path(zip_path.c_str());
ZipEntry entry;
- if (FindEntry(za, zip_string_path, &entry) != 0) {
+ if (FindEntry(za, zip_path, &entry) != 0) {
LOG(ERROR) << name << ": no " << zip_path << " in package";
return StringValue("");
}
@@ -174,9 +173,8 @@ Value* PackageExtractFileFn(const char* name, State* state,
const std::string& zip_path = args[0];
ZipArchiveHandle za = static_cast<UpdaterInfo*>(state->cookie)->package_zip;
- ZipString zip_string_path(zip_path.c_str());
ZipEntry entry;
- if (FindEntry(za, zip_string_path, &entry) != 0) {
+ if (FindEntry(za, zip_path, &entry) != 0) {
return ErrorAbort(state, kPackageExtractFileFailure, "%s(): no %s in package", name,
zip_path.c_str());
}
diff --git a/updater/updater.cpp b/updater/updater.cpp
index 7b5a3f938..a020699ca 100644
--- a/updater/updater.cpp
+++ b/updater/updater.cpp
@@ -101,9 +101,8 @@ int main(int argc, char** argv) {
return 3;
}
- ZipString script_name(SCRIPT_NAME);
ZipEntry script_entry;
- int find_err = FindEntry(za, script_name, &script_entry);
+ int find_err = FindEntry(za, SCRIPT_NAME, &script_entry);
if (find_err != 0) {
LOG(ERROR) << "failed to find " << SCRIPT_NAME << " in " << package_filename << ": "
<< ErrorCodeString(find_err);