On 32-bit machine strtol() returns LONG_MAX which is 0x7fffffff,
which is wrong for u-boot.rom components like u-boot-x86-16bit.bin.
Change to use strtoll() so that it works on both 32-bit and 64-bit
machines.

Reported-by: Fei Wang <wangfei.ji...@gmail.com>
Signed-off-by: Bin Meng <bmeng...@gmail.com>
---

 tools/ifdtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ifdtool.c b/tools/ifdtool.c
index 1d61df1..df16616 100644
--- a/tools/ifdtool.c
+++ b/tools/ifdtool.c
@@ -987,7 +987,7 @@ int main(int argc, char *argv[])
                                        print_usage(argv[0]);
                                        exit(EXIT_FAILURE);
                                }
-                               ifile->addr = strtol(optarg, NULL, 0);
+                               ifile->addr = strtoll(optarg, NULL, 0);
                                ifile->type = opt == 'f' ? IF_fdt :
                                        opt == 'U' ? IF_uboot : IF_normal;
                                if (ifile->type == IF_fdt)
-- 
1.8.2.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to