net: Fix arguments in tftpput command
PATCH 1/1 net: Fix arguments in tftpput command
The switch to strict_strtoul() was not done correctly - this fixes the compile error when CONFIG_CMD_TFTPPUT is active.
--- common/cmd_net.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
common/cmd_net.c +2 -2
@@ -221,8 +221,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,#ifdef CONFIG_CMD_TFTPPUT case 4 : - save_addr =strict_strtoul (argv[1 ],NULL ,16 ); - save_size =strict_strtoul (argv[2 ],NULL ,16 ); +strict_strtoul (argv[1 ],16 , &save_addr); +strict_strtoul (argv[2 ],16 , &save_size);copy_filename (BootFile, argv[3 ],sizeof (BootFile));break ;#endif
Signature · 1 line
1.7.3.1
PATCH 1/1 net: Fix arguments in tftpput command
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111217/01d22ff1/attachment.pgp>
PATCH 1/1 net: Fix arguments in tftpput command
In reply to Simon GlassDear Simon Glass,
Quoted 13 lines · In message <[email protected]> you wrote:
The switch to
strict_strtoul()was not done correctly - this fixes the compile error whenCONFIG_CMD_TFTPPUTis active.Signed-off-by Simon Glass <[email protected]>--- common/cmd_net.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)common/cmd_net.c +0
-0
common/cmd_net.c static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, · line 225
Quoted 7 lines
common/cmd_net.c +2
-2@@ -221,8 +221,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,#ifdef CONFIG_CMD_TFTPPUT case 4 : - save_addr =strict_strtoul (argv[1 ],NULL ,16 ); - save_size =strict_strtoul (argv[2 ],NULL ,16 ); +strict_strtoul (argv[1 ],16 , &save_addr); +strict_strtoul (argv[2 ],16 , &save_size);
strict_strtoul() returns error codes. We should not ignore these.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Vulcans believe peace should not depend on force. -- Amanda, "Journey to Babel", stardate 3842.3
PATCH 1/1 net: Fix arguments in tftpput command
Hi Wolfgang,
Quoted 17 lines · Wolfgang Denk
Dear Simon Glass,
Quoted 14 lines · In message <[email protected]> you wrote:
The switch to
strict_strtoul()was not done correctly - this fixes the compile error whenCONFIG_CMD_TFTPPUTis active.Signed-off-by Simon Glass <[email protected]>---
?common/cmd_net.c | ? ?4 ++--
?1 files changed, 2 insertions(+), 2 deletions(-)common/cmd_net.c +0
-0@@ -221,8 +221,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
Quoted 8 lines
Quoted 6 lines
?#ifdef
CONFIG_CMD_TFTPPUT
? ? ? case 4:
- ? ? ? ? ? ?save_addr=strict_strtoul(argv[1], NULL, 16);
- ? ? ? ? ? ?save_size=strict_strtoul(argv[2], NULL, 16);
+ ? ? ? ? ? ?strict_strtoul(argv[1], 16, &save_addr);
+ ? ? ? ? ? ?strict_strtoul(argv[2], 16, &save_size);
strict_strtoul()returns error codes. ?We should not ignore these.
Er yes, I wondered about that. I will resubmit with a cmd_usage() in that case.
Regards,
Simon
Quoted 11 lines
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Vulcans believe peace should not depend on force.
? ? ? ?-- Amanda, "Journey to Babel", stardate 3842.3