mirror of
https://github.com/ggrandou/abootimg.git
synced 2024-11-23 01:43:26 +08:00
fixed silly warnings due to -Wall
This commit is contained in:
parent
6a7ce6cad0
commit
4f8acfd128
14
abootimg.c
14
abootimg.c
@ -203,6 +203,10 @@ enum command parse_args(int argc, char** argv, t_abootimg* img)
|
||||
return none;
|
||||
|
||||
switch(cmd) {
|
||||
case none:
|
||||
case help:
|
||||
break;
|
||||
|
||||
case info:
|
||||
if (argc != 3)
|
||||
return none;
|
||||
@ -275,7 +279,7 @@ enum command parse_args(int argc, char** argv, t_abootimg* img)
|
||||
|
||||
int check_boot_img_header(t_abootimg* img)
|
||||
{
|
||||
if (strncmp(img->header.magic, BOOT_MAGIC, BOOT_MAGIC_SIZE)) {
|
||||
if (strncmp((char*)(img->header.magic), BOOT_MAGIC, BOOT_MAGIC_SIZE)) {
|
||||
fprintf(stderr, "%s: no Android Magic Value\n", img->fname);
|
||||
return 1;
|
||||
}
|
||||
@ -421,10 +425,10 @@ void update_header_entry(t_abootimg* img, char* cmd)
|
||||
if (len >= BOOT_ARGS_SIZE)
|
||||
abort_printf("cmdline length (%d) is too long (max %d)", len, BOOT_ARGS_SIZE-1);
|
||||
memset(img->header.cmdline, 0, BOOT_ARGS_SIZE);
|
||||
strcpy(img->header.cmdline, value);
|
||||
strcpy((char*)(img->header.cmdline), value);
|
||||
}
|
||||
else if (!strncmp(token, "name", 4)) {
|
||||
strncpy(img->header.name, value, BOOT_NAME_SIZE);
|
||||
strncpy((char*)(img->header.name), value, BOOT_NAME_SIZE);
|
||||
img->header.name[BOOT_NAME_SIZE-1] = '\0';
|
||||
}
|
||||
else if (!strncmp(token, "bootsize", 8)) {
|
||||
@ -640,9 +644,7 @@ void write_bootimg(t_abootimg* img)
|
||||
|
||||
unsigned n = (img->header.kernel_size + psize - 1) / psize;
|
||||
unsigned m = (img->header.ramdisk_size + psize - 1) / psize;
|
||||
unsigned o = (img->header.second_size + psize - 1) / psize;
|
||||
unsigned total_pages = 1+n+m+o;
|
||||
unsigned bootimg_pages = img->size/psize;
|
||||
//unsigned o = (img->header.second_size + psize - 1) / psize;
|
||||
|
||||
if (fseek(img->stream, 0, SEEK_SET))
|
||||
abort_perror(img->fname);
|
||||
|
Loading…
Reference in New Issue
Block a user