From: Chris Packham Date: Fri, 13 May 2011 13:27:26 +1200 Subject: [U-Boot] [PATCH 2/3] sntp: avoid use of uninitialized variable In-Reply-To: <1305250047-7212-1-git-send-email-judge.packham@gmail.com> References: <1305250047-7212-1-git-send-email-judge.packham@gmail.com> Message-ID: <1305250047-7212-2-git-send-email-judge.packham@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Luuk Paulussen 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 Acked-by: Chris Packham Cc: Ben Warren --- common/cmd_net.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/common/cmd_net.c b/common/cmd_net.c index 8c6f5c8..e0d7d23 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -324,7 +324,7 @@ 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; } -- 1.7.4.1