* [U-Boot] [PATCH] tools: ifdtool: Write correct offset on 32-bit machine
@ 2015-07-06 7:57 Bin Meng
2015-07-06 16:39 ` Simon Glass
0 siblings, 1 reply; 3+ messages in thread
From: Bin Meng @ 2015-07-06 7:57 UTC (permalink / raw)
To: u-boot
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>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] tools: ifdtool: Write correct offset on 32-bit machine
2015-07-06 7:57 [U-Boot] [PATCH] tools: ifdtool: Write correct offset on 32-bit machine Bin Meng
@ 2015-07-06 16:39 ` Simon Glass
2015-07-07 22:55 ` Simon Glass
0 siblings, 1 reply; 3+ messages in thread
From: Simon Glass @ 2015-07-06 16:39 UTC (permalink / raw)
To: u-boot
On 6 July 2015 at 01:57, Bin Meng <bmeng.cn@gmail.com> wrote:
> 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>
> ---
>
> tools/ifdtool.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks for fixing this.
Acked-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] tools: ifdtool: Write correct offset on 32-bit machine
2015-07-06 16:39 ` Simon Glass
@ 2015-07-07 22:55 ` Simon Glass
0 siblings, 0 replies; 3+ messages in thread
From: Simon Glass @ 2015-07-07 22:55 UTC (permalink / raw)
To: u-boot
On 6 July 2015 at 10:39, Simon Glass <sjg@chromium.org> wrote:
> On 6 July 2015 at 01:57, Bin Meng <bmeng.cn@gmail.com> wrote:
>> 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>
>> ---
>>
>> tools/ifdtool.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Thanks for fixing this.
>
> Acked-by: Simon Glass <sjg@chromium.org>
Applied to u-boot-x86, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-07 22:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-06 7:57 [U-Boot] [PATCH] tools: ifdtool: Write correct offset on 32-bit machine Bin Meng
2015-07-06 16:39 ` Simon Glass
2015-07-07 22:55 ` Simon Glass
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.