Skip to content
Snippets Groups Projects
Commit 50e8a6bb authored by Bin Meng's avatar Bin Meng Committed by Simon Glass
Browse files

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: default avatarFei Wang <wangfei.jimei@gmail.com>
Signed-off-by: default avatarBin Meng <bmeng.cn@gmail.com>
Acked-by: default avatarSimon Glass <sjg@chromium.org>
parent df898678
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment