summaryrefslogtreecommitdiff
path: root/tools/ifdtool.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2015-07-06 15:57:06 +0800
committerSimon Glass <sjg@chromium.org>2015-07-14 18:03:19 -0600
commit50e8a6bba0cf5939afe849ef792f88f09a755758 (patch)
treea7e39522c0b7c53540041e516640e49563034b5a /tools/ifdtool.c
parentdf898678ab96b904b962743bb5388284c712b9fb (diff)
downloadu-boot-imx-50e8a6bba0cf5939afe849ef792f88f09a755758.zip
u-boot-imx-50e8a6bba0cf5939afe849ef792f88f09a755758.tar.gz
u-boot-imx-50e8a6bba0cf5939afe849ef792f88f09a755758.tar.bz2
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 <wangfei.jimei@gmail.com> Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/ifdtool.c')
-rw-r--r--tools/ifdtool.c2
1 files changed, 1 insertions, 1 deletions
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)