summaryrefslogtreecommitdiffstats
path: root/applypatch/bspatch.c
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/bspatch.c
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/bspatch.cpp (renamed from applypatch/bspatch.c)5
1 files changed, 2 insertions, 3 deletions
diff --git a/applypatch/bspatch.c b/applypatch/bspatch.cpp
index b57760eda..9d201b477 100644
--- a/applypatch/bspatch.c
+++ b/applypatch/bspatch.cpp
@@ -182,10 +182,9 @@ int ApplyBSDiffPatchMem(const unsigned char* old_data, ssize_t old_size,
printf("failed to bzinit extra stream (%d)\n", bzerr);
}
- *new_data = malloc(*new_size);
+ *new_data = reinterpret_cast<unsigned char*>(malloc(*new_size));
if (*new_data == NULL) {
- printf("failed to allocate %ld bytes of memory for output file\n",
- (long)*new_size);
+ printf("failed to allocate %zd bytes of memory for output file\n", *new_size);
return 1;
}