@@ -263,11 +263,11 @@ void* mbn_stitch(const void* data, size_t data_size, const void* blob, size_t bl
263263
264264 off_t stitch_offset = data_size - blob_size ;
265265 if (stitch_offset + blob_size > data_size ) {
266- logger (LL_ERROR , "%s: stitch offset (0x%llx ) + size (0x%zx) is larger than the destination (0x%zx)\n" , __func__ , stitch_offset , blob_size , data_size );
266+ logger (LL_ERROR , "%s: stitch offset (0x%lx ) + size (0x%zx) is larger than the destination (0x%zx)\n" , __func__ , ( unsigned long ) stitch_offset , blob_size , data_size );
267267 return NULL ;
268268 }
269269
270- void * buf = malloc (data_size );
270+ unsigned char * buf = malloc (data_size );
271271 if (buf == NULL ) {
272272 logger (LL_ERROR , "out of memory\n" );
273273 return NULL ;
@@ -409,7 +409,7 @@ void* mbn_mav25_stitch(const void* data, size_t data_size, const void* blob, siz
409409 }
410410
411411 if (sect_off + sect_size > data_size ) {
412- logger (LL_ERROR , "%s: section (0x%llx +0x%zx) is bigger than the data\n" , __func__ , sect_off , sect_size );
412+ logger (LL_ERROR , "%s: section (0x%lx +0x%zx) is bigger than the data\n" , __func__ , ( unsigned long ) sect_off , sect_size );
413413 return NULL ;
414414 }
415415
@@ -442,8 +442,7 @@ void* mbn_mav25_stitch(const void* data, size_t data_size, const void* blob, siz
442442 size_t new_oem_sig_and_cert_chain_size =
443443 src_header -> oem_signature_size + src_header -> oem_certificate_chain_size ;
444444 off_t new_oem_sig_and_cert_chain_off = new_metadata_and_hash_table_size +
445- header -> qti_signature_size +
446- header -> qti_certificate_chain_size ;
445+ header -> qti_signature_size + header -> qti_certificate_chain_size ;
447446
448447 if (new_metadata_and_hash_table_size > blob_size ) {
449448 logger (LL_ERROR , "%s: new metadata (0x%zx) and hash table (0x%x) are bigger than the source (0x%zx)\n" , __func__ , new_metadata_size , src_header -> hash_table_size , blob_size );
@@ -465,16 +464,16 @@ void* mbn_mav25_stitch(const void* data, size_t data_size, const void* blob, siz
465464 return NULL ;
466465 }
467466
468- void * buf = malloc (data_size );
467+ unsigned char * buf = malloc (data_size );
469468 if (buf == NULL ) {
470469 logger (LL_ERROR , "out of memory\n" );
471470 return NULL ;
472471 }
473472
474473 memcpy (buf , data , data_size );
475- logger (LL_DEBUG , "%s: stitching mbn at 0x%llx (0x%zx bytes)\n" , __func__ , sect_off , new_metadata_and_hash_table_size );
474+ logger (LL_DEBUG , "%s: stitching mbn at 0x%lx (0x%zx bytes)\n" , __func__ , ( unsigned long ) sect_off , new_metadata_and_hash_table_size );
476475 memcpy (buf + sect_off , blob , new_metadata_and_hash_table_size );
477- logger (LL_DEBUG , "%s: stitching mbn at 0x%llx (0x%zx bytes)\n" , __func__ , sect_off + new_oem_sig_and_cert_chain_off , new_oem_sig_and_cert_chain_size );
476+ logger (LL_DEBUG , "%s: stitching mbn at 0x%lx (0x%zx bytes)\n" , __func__ , ( unsigned long )( sect_off + new_oem_sig_and_cert_chain_off ) , new_oem_sig_and_cert_chain_size );
478477 memcpy (buf + sect_off + new_oem_sig_and_cert_chain_off , blob + new_metadata_and_hash_table_size , new_oem_sig_and_cert_chain_size );
479478
480479 return buf ;
0 commit comments