From f3bb31c32fa879ccce358c15c93b7bd8582d1756 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Fri, 14 Mar 2014 09:39:48 -0700 Subject: Recovery 64-bit compile issues Change-Id: I92d5abd1a628feab3b0246924fab7f97ba3b9d34 --- applypatch/imgpatch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'applypatch/imgpatch.c') diff --git a/applypatch/imgpatch.c b/applypatch/imgpatch.c index 3a1df3872..af4d07281 100644 --- a/applypatch/imgpatch.c +++ b/applypatch/imgpatch.c @@ -18,6 +18,7 @@ // format. #include +#include #include #include #include @@ -35,7 +36,7 @@ * file, and update the SHA context with the output data as well. * Return 0 on success. */ -int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size, +int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size __unused, const Value* patch, SinkFn sink, void* token, SHA_CTX* ctx, const Value* bonus_data) { @@ -132,7 +133,7 @@ int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size, unsigned char* expanded_source = malloc(expanded_len); if (expanded_source == NULL) { - printf("failed to allocate %d bytes for expanded_source\n", + printf("failed to allocate %zu bytes for expanded_source\n", expanded_len); return -1; } @@ -163,7 +164,7 @@ int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size, // We should have filled the output buffer exactly, except // for the bonus_size. if (strm.avail_out != bonus_size) { - printf("source inflation short by %d bytes\n", strm.avail_out-bonus_size); + printf("source inflation short by %zu bytes\n", strm.avail_out-bonus_size); return -1; } inflateEnd(&strm); -- cgit v1.2.3 From bc7ffeda98a861e346c30c771d3258030f7fcf21 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Fri, 15 Aug 2014 14:31:52 -0700 Subject: installer for new block OTA system (Cherry-pick back from master.) Bug: 16984795 Change-Id: Ifa3d8345c5e2a0be86fb28faa080ca82592a96b4 --- applypatch/imgpatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'applypatch/imgpatch.c') diff --git a/applypatch/imgpatch.c b/applypatch/imgpatch.c index af4d07281..33c448762 100644 --- a/applypatch/imgpatch.c +++ b/applypatch/imgpatch.c @@ -95,7 +95,7 @@ int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size __unused, printf("failed to read chunk %d raw data\n", i); return -1; } - SHA_update(ctx, patch->data + pos, data_len); + if (ctx) SHA_update(ctx, patch->data + pos, data_len); if (sink((unsigned char*)patch->data + pos, data_len, token) != data_len) { printf("failed to write chunk %d raw data\n", i); @@ -217,7 +217,7 @@ int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size __unused, (long)have); return -1; } - SHA_update(ctx, temp_data, have); + if (ctx) SHA_update(ctx, temp_data, have); } while (ret != Z_STREAM_END); deflateEnd(&strm); -- cgit v1.2.3