summaryrefslogtreecommitdiffstats
path: root/applypatch/imgpatch.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2015-06-24 08:23:33 +0200
committerTao Bao <tbao@google.com>2015-07-14 02:21:31 +0200
commitba9a42aa7e10686de186636fe9fecbf8c4cc7c19 (patch)
tree47a62ed3cf643578280ddb1982599ed8345dd071 /applypatch/imgpatch.cpp
parentMerge "Revert "Zero blocks before BLKDISCARD"" (diff)
downloadandroid_bootable_recovery-ba9a42aa7e10686de186636fe9fecbf8c4cc7c19.tar
android_bootable_recovery-ba9a42aa7e10686de186636fe9fecbf8c4cc7c19.tar.gz
android_bootable_recovery-ba9a42aa7e10686de186636fe9fecbf8c4cc7c19.tar.bz2
android_bootable_recovery-ba9a42aa7e10686de186636fe9fecbf8c4cc7c19.tar.lz
android_bootable_recovery-ba9a42aa7e10686de186636fe9fecbf8c4cc7c19.tar.xz
android_bootable_recovery-ba9a42aa7e10686de186636fe9fecbf8c4cc7c19.tar.zst
android_bootable_recovery-ba9a42aa7e10686de186636fe9fecbf8c4cc7c19.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;
}