diff options
Diffstat (limited to 'misc-utils')
-rw-r--r-- | misc-utils/fectest.c | 2 | ||||
-rw-r--r-- | misc-utils/flash_erase.c | 2 | ||||
-rw-r--r-- | misc-utils/flashcp.c | 2 | ||||
-rw-r--r-- | misc-utils/ftl_check.c | 4 |
4 files changed, 7 insertions, 3 deletions
diff --git a/misc-utils/fectest.c b/misc-utils/fectest.c index eb1d33e..f560f2b 100644 --- a/misc-utils/fectest.c +++ b/misc-utils/fectest.c @@ -87,6 +87,6 @@ int main(void) exit(1); } - printf("Decoded in %ld.%06lds\n", now.tv_sec, now.tv_usec); + printf("Decoded in %ld.%06lds\n", (long)now.tv_sec, (long)now.tv_usec); return 0; } diff --git a/misc-utils/flash_erase.c b/misc-utils/flash_erase.c index c6f6f66..36f8d57 100644 --- a/misc-utils/flash_erase.c +++ b/misc-utils/flash_erase.c @@ -239,7 +239,7 @@ int main(int argc, char *argv[]) if (eb_cnt == 0) eb_cnt = (mtd.size / mtd.eb_size) - eb_start; - if (eb_start == 0 && mtd.size == eb_cnt * mtd.eb_size) + if (eb_start == 0 && mtd.size == (long long)eb_cnt * mtd.eb_size) erase_chip = true; /* If MTD device may have bad eraseblocks, diff --git a/misc-utils/flashcp.c b/misc-utils/flashcp.c index 9c48637..6065a8c 100644 --- a/misc-utils/flashcp.c +++ b/misc-utils/flashcp.c @@ -221,7 +221,7 @@ int main (int argc,char *argv[]) struct mtd_info_user mtd; struct erase_info_user erase; struct stat filestat; - unsigned char *src,*dest,*wrlast_buf; + unsigned char *src, *dest, *wrlast_buf = NULL; unsigned long long wrlast_len = 0; int error = 0; diff --git a/misc-utils/ftl_check.c b/misc-utils/ftl_check.c index 5b2dae5..fe6a91a 100644 --- a/misc-utils/ftl_check.c +++ b/misc-utils/ftl_check.c @@ -121,6 +121,10 @@ static void check_partition(int fd) /* Create basic block allocation table for control blocks */ nbam = (mtd.erasesize >> hdr.BlockSize); bam = malloc(nbam * sizeof(u_int)); + if (!bam) { + perror("malloc failed"); + return; + } for (i = 0; i < le16_to_cpu(hdr.NumEraseUnits); i++) { if (lseek(fd, (i << hdr.EraseUnitSize), SEEK_SET) == -1) { |