Skip to content

Commit

Permalink
mtd: fix build with GCC 14
Browse files Browse the repository at this point in the history
Also fix a couple of warnings while at it.

Signed-off-by: Rui Salvaterra <[email protected]>
  • Loading branch information
rsalvaterra committed May 12, 2024
1 parent c758d64 commit da0cd9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions package/system/mtd/src/trx.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <endian.h>
#include <string.h>
#include <errno.h>
#include <netinet/in.h>

#include <sys/ioctl.h>
#include <mtd/mtd-user.h>
Expand Down Expand Up @@ -165,7 +166,7 @@ mtd_fixtrx(const char *mtd, size_t offset, size_t data_size)
size_t block_offset;

if (quiet < 2)
fprintf(stderr, "Trying to fix trx header in %s at 0x%x...\n", mtd, offset);
fprintf(stderr, "Trying to fix trx header in %s at 0x%zx...\n", mtd, offset);

fd = mtd_check_open(mtd);
if(fd < 0) {
Expand Down Expand Up @@ -246,7 +247,7 @@ mtd_fixtrx(const char *mtd, size_t offset, size_t data_size)

trx->crc32 = STORE32_LE(crc32buf(buf, data_size));
if (mtd_erase_block(fd, block_offset)) {
fprintf(stderr, "Can't erease block at 0x%x (%s)\n", block_offset, strerror(errno));
fprintf(stderr, "Can't erease block at 0x%zx (%s)\n", block_offset, strerror(errno));
exit(1);
}

Expand Down

0 comments on commit da0cd9d

Please sign in to comment.