From: Thadeu Lima de Souza Cascardo Date: Tue, 2 Aug 2016 10:55:49 +0000 (-0300) Subject: Fix for 64-bit platforms. X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fbootimg.git;a=commitdiff_plain;h=8361cf46dd59aa1238ca020f36d168c4b685b9f1;hp=8ce96b74e121a9eb786fb4f6a24e1206ebbf035d Fix for 64-bit platforms. On 64-bit platforms, size_t has 64 bits. So load address was overwritten when changing the kernel size, which broke boot of the generated images. Signed-off-by: Thadeu Lima de Souza Cascardo --- diff --git a/bootimg.c b/bootimg.c index cacd658..7e38e0a 100644 --- a/bootimg.c +++ b/bootimg.c @@ -25,7 +25,7 @@ #include #include -static int dump_or_load(int fd, size_t *len, int pgsz, char *fname, int dump) +static int dump_or_load(int fd, uint32_t *len, int pgsz, char *fname, int dump) { int cfd; char *page; @@ -92,12 +92,12 @@ out: return -EINVAL; } -static int dump(int fd, size_t len, int pgsz, char *fname) +static int dump(int fd, uint32_t len, int pgsz, char *fname) { return dump_or_load(fd, &len, pgsz, fname, 1); } -static int load(int fd, size_t *len, int pgsz, char *fname) +static int load(int fd, uint32_t *len, int pgsz, char *fname) { return dump_or_load(fd, len, pgsz, fname, 0); }