From mboxrd@z Thu Jan 1 00:00:00 1970 From: Detlev Zundel Date: Tue, 17 May 2011 10:32:28 +0200 Subject: [U-Boot] [PATCHv2] sntp: avoid use of uninitialized variable In-Reply-To: <1305606431-13473-1-git-send-email-judge.packham@gmail.com> (Chris Packham's message of "Tue, 17 May 2011 16:27:11 +1200") References: <1305606431-13473-1-git-send-email-judge.packham@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Chris, > 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 > --- > Changes since v1: > - run through checkpatch.pl, fix line > 80 chars > > 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 8c6f5c8..fae3c7f 100644 > --- a/common/cmd_net.c > +++ b/common/cmd_net.c > @@ -324,7 +324,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; > } Acked-by: Detlev Zundel Cheers Detlev -- Is this a private fight or can anyone join in? -- Old Irish saying -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de