From: Bin Meng Date: Mon, 6 Jul 2015 07:57:06 +0000 (+0800) Subject: tools: ifdtool: Write correct offset on 32-bit machine X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=50e8a6bba0cf5939afe849ef792f88f09a755758;p=u-boot.git tools: ifdtool: Write correct offset on 32-bit machine 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 Signed-off-by: Bin Meng Acked-by: Simon Glass --- diff --git a/tools/ifdtool.c b/tools/ifdtool.c index 1d61df19f2..df166161f4 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)