summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2019-01-12 00:24:55 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2019-01-16 08:33:34 +0100
commit3d036263a42c2fd89272a68c457d31018a878de5 (patch)
tree222d8243d93847d47a5633e70f46a7b5a7cd3307 /commands
parentb77582effd360f15da2a42c2ad3c45f8cbc6dba9 (diff)
downloadbarebox-3d036263a42c2fd89272a68c457d31018a878de5.tar.gz
barebox-3d036263a42c2fd89272a68c457d31018a878de5.tar.xz
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 <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/digest.c3
1 files changed, 2 insertions, 1 deletions
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 <common.h>
#include <command.h>
+#include <linux/pagemap.h>
#include <fs.h>
#include <fcntl.h>
#include <errno.h>
@@ -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 */