From 3d036263a42c2fd89272a68c457d31018a878de5 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sat, 12 Jan 2019 00:24:55 -0800 Subject: commands: digest: Use MAX_LFS_FILESIZE instead of ~0 Loff_t is a signed type, so ~0 is a negative number. While it works OK due to clamping/conversion to ulong when passed to digest_file_window(), it is better not to rely on that fact and use an appropriate constant. Signed-off-by: Andrey Smirnov Signed-off-by: Sascha Hauer --- commands/digest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'commands') diff --git a/commands/digest.c b/commands/digest.c index 0edbbec32c..99b27dcc25 100644 --- a/commands/digest.c +++ b/commands/digest.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -35,7 +36,7 @@ int __do_digest(struct digest *d, unsigned char *sig, while (*argv) { char *filename = "/dev/mem"; - loff_t start = 0, size = ~0; + loff_t start = 0, size = MAX_LFS_FILESIZE; int show_area = 1; /* arguments are either file, file+area or area */ -- cgit v1.2.3