From f3f3a208048eac5f8b5752a17ebcd44db9230fd8 Mon Sep 17 00:00:00 2001 From: Richard Genoud Date: Wed, 12 Sep 2012 16:38:34 +0200 Subject: consistency between u_int32_t / off_t / off64_t We should use the off_t type instead of off64_t or u_int32_t as its length is controlled by the WITHOUT_LARGEFILE flag. Signed-off-by: Richard Genoud Signed-off-by: Artem Bityutskiy --- flash_otp_write.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'flash_otp_write.c') diff --git a/flash_otp_write.c b/flash_otp_write.c index d407ebb..56769ec 100644 --- a/flash_otp_write.c +++ b/flash_otp_write.c @@ -13,6 +13,7 @@ #include #include +#include #include int main(int argc,char *argv[]) @@ -47,7 +48,7 @@ int main(int argc,char *argv[]) return errno; } - offset = strtoul(argv[3], &p, 0); + offset = (off_t)strtoull(argv[3], &p, 0); if (argv[3][0] == 0 || *p != 0) { fprintf(stderr, "%s: bad offset value\n", PROGRAM_NAME); return ERANGE; @@ -58,7 +59,7 @@ int main(int argc,char *argv[]) return errno; } - printf("Writing OTP user data on %s at offset 0x%lx\n", argv[2], offset); + printf("Writing OTP user data on %s at offset 0x%"PRIxoff_t"\n", argv[2], offset); if (mtdInfo.type == MTD_NANDFLASH) len = mtdInfo.writesize; -- cgit v1.2.3