summaryrefslogtreecommitdiffstats
path: root/applypatch/imgpatch.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2015-07-15 00:52:24 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-15 00:52:24 +0200
commit3231c7ca7f6534adf50474c8db57b1ba3c6cfe2f (patch)
tree500677af2c571ac6f43bbc1f5b4b24d52a68d7ec /applypatch/imgpatch.cpp
parentam f2853e27: am 65c230f4: Merge "Revert "Zero blocks before BLKDISCARD"" (diff)
parentam 0bacbfd0: Merge "recovery: Switch applypatch/ and updater/ to cpp." (diff)
downloadandroid_bootable_recovery-3231c7ca7f6534adf50474c8db57b1ba3c6cfe2f.tar
android_bootable_recovery-3231c7ca7f6534adf50474c8db57b1ba3c6cfe2f.tar.gz
android_bootable_recovery-3231c7ca7f6534adf50474c8db57b1ba3c6cfe2f.tar.bz2
android_bootable_recovery-3231c7ca7f6534adf50474c8db57b1ba3c6cfe2f.tar.lz
android_bootable_recovery-3231c7ca7f6534adf50474c8db57b1ba3c6cfe2f.tar.xz
android_bootable_recovery-3231c7ca7f6534adf50474c8db57b1ba3c6cfe2f.tar.zst
android_bootable_recovery-3231c7ca7f6534adf50474c8db57b1ba3c6cfe2f.zip
Diffstat (limited to '')
-rw-r--r--applypatch/imgpatch.cpp (renamed from applypatch/imgpatch.c)4
1 files changed, 2 insertions, 2 deletions
diff --git a/applypatch/imgpatch.c b/applypatch/imgpatch.cpp
index 09b0a7397..26888f8ee 100644
--- a/applypatch/imgpatch.c
+++ b/applypatch/imgpatch.cpp
@@ -132,7 +132,7 @@ int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size __unused,
// must be appended from the bonus_data value.
size_t bonus_size = (i == 1 && bonus_data != NULL) ? bonus_data->size : 0;
- unsigned char* expanded_source = malloc(expanded_len);
+ unsigned char* expanded_source = reinterpret_cast<unsigned char*>(malloc(expanded_len));
if (expanded_source == NULL) {
printf("failed to allocate %zu bytes for expanded_source\n",
expanded_len);
@@ -196,7 +196,7 @@ int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size __unused,
// ... unless the buffer is too small, in which case we'll
// allocate a fresh one.
free(temp_data);
- temp_data = malloc(32768);
+ temp_data = reinterpret_cast<unsigned char*>(malloc(32768));
temp_size = 32768;
}