Skip to content

Commit

Permalink
unpackbootimg: Correct the output format of sizeof(header)
Browse files Browse the repository at this point in the history
 * The type returned by sizeof(header) is long unsigned int,
   and the output format is %d.

Signed-off-by: TH779 <tongsj2333@gmail.com>
  • Loading branch information
KujouYuko authored and osm0sis committed Apr 15, 2021
1 parent 2e7ab47 commit edeb684
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions unpackbootimg.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ int main(int argc, char **argv)
write_string_to_file("hashtype", hash_type);

total_read += sizeof(header);
if(debug>1){printf("read: %d\n", sizeof(header));}
if(debug>1){printf("read: %ld\n", sizeof(header));}
total_read += read_padding(f, sizeof(header));

write_buffer_to_file("kernel", f, header.kernel_size);
Expand Down Expand Up @@ -348,7 +348,7 @@ int main(int argc, char **argv)
write_string_to_file("header_version", hdrvertmp);

total_read += sizeof(header);
if(debug>1){printf("read: %d\n", sizeof(header));}
if(debug>1){printf("read: %ld\n", sizeof(header));}
total_read += read_padding(f, sizeof(header));

write_buffer_to_file("kernel", f, header.kernel_size);
Expand Down Expand Up @@ -415,7 +415,7 @@ int main(int argc, char **argv)
write_string_to_file("dtb_offset", dtbofftmp);

total_read += sizeof(header);
if(debug>1){printf("read: %d\n", sizeof(header));}
if(debug>1){printf("read: %ld\n", sizeof(header));}
total_read += read_padding(f, sizeof(header));

write_buffer_to_file("vendor_ramdisk", f, header.vendor_ramdisk_size);
Expand Down

0 comments on commit edeb684

Please sign in to comment.