diff options
author | Luuk Paulussen <luuk.paulussen@alliedtelesis.co.nz> | 2011-05-16 18:27:11 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-06-01 22:35:09 +0200 |
commit | d6840e3d7abb71c2a45c3788dcc6edf7feb1d303 (patch) | |
tree | 48b8cf1f0ee07eac9a71c366e7d173cb42233b4e /common/cmd_net.c | |
parent | bd0d19cc5f346ff6504d47497ec799e066168b96 (diff) | |
download | u-boot-imx-d6840e3d7abb71c2a45c3788dcc6edf7feb1d303.zip u-boot-imx-d6840e3d7abb71c2a45c3788dcc6edf7feb1d303.tar.gz u-boot-imx-d6840e3d7abb71c2a45c3788dcc6edf7feb1d303.tar.bz2 |
sntp: avoid use of uninitialized variable
When we use the ntpserverip environment variable argv[1] may not be set.
Printing the error message using the NetNtpServerIP variable ensures the
correct output in both cases.
Signed-off-by: Luuk Paulussen <luuk.paulussen@alliedtelesis.co.nz>
Acked-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: Ben Warren <biggerbadderben@gmail.com>
Acked-by: Detlev Zundel <dzu@denx.de>
Diffstat (limited to 'common/cmd_net.c')
-rw-r--r-- | common/cmd_net.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/cmd_net.c b/common/cmd_net.c index b2c9355..75ba1c3 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -341,7 +341,8 @@ int do_sntp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) else NetTimeOffset = simple_strtol (toff, NULL, 10); if (NetLoop(SNTP) < 0) { - printf("SNTP failed: host %s not responding\n", argv[1]); + printf("SNTP failed: host %pI4 not responding\n", + &NetNtpServerIP); return 1; } |