summaryrefslogtreecommitdiffstats
path: root/applypatch/imgpatch.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2015-06-24 08:23:33 +0200
committerRom Lemarchand <romlem@google.com>2015-11-16 23:28:40 +0100
commit818fa781d1dbe35c0c5bfff3ebff1b45a2a676f0 (patch)
tree3c32987d95d99c06afbfd9b8d55ee2c5346c2683 /applypatch/imgpatch.cpp
parentAdd error and range checks to parse_range (diff)
downloadandroid_bootable_recovery-818fa781d1dbe35c0c5bfff3ebff1b45a2a676f0.tar
android_bootable_recovery-818fa781d1dbe35c0c5bfff3ebff1b45a2a676f0.tar.gz
android_bootable_recovery-818fa781d1dbe35c0c5bfff3ebff1b45a2a676f0.tar.bz2
android_bootable_recovery-818fa781d1dbe35c0c5bfff3ebff1b45a2a676f0.tar.lz
android_bootable_recovery-818fa781d1dbe35c0c5bfff3ebff1b45a2a676f0.tar.xz
android_bootable_recovery-818fa781d1dbe35c0c5bfff3ebff1b45a2a676f0.tar.zst
android_bootable_recovery-818fa781d1dbe35c0c5bfff3ebff1b45a2a676f0.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;
}