All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Weber <weber@corscience.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC/PATCHv2 2/2] Common/cmd_nvedit: Check for env subcommand
Date: Wed, 24 Nov 2010 13:07:52 +0100	[thread overview]
Message-ID: <1290600472-23147-2-git-send-email-weber@corscience.de> (raw)
In-Reply-To: <20101124110719.C428C135EA0@gemini.denx.de>

The env command needs one subcommand. If this is not available
print the usage help.

Signed-off-by: Thomas Weber <weber@corscience.de>
---
 common/cmd_nvedit.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 3fd8abc..52c5e7c 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -848,6 +848,9 @@ static int do_env (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	cmd_tbl_t *cp;
 
+	if (argc < 2)
+		return cmd_usage(cmdtp);
+
 	/* drop initial "env" arg */
 	argc--;
 	argv++;
-- 
1.7.3.2

  parent reply	other threads:[~2010-11-24 12:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-24 10:15 [U-Boot] [RFC/PATCH] common/command.c: Guard strchr/strlen from NULL pointer Thomas Weber
2010-11-24 11:07 ` Wolfgang Denk
2010-11-24 12:07   ` [U-Boot] [RFC/PATCHv2 1/2] Common/command: " Thomas Weber
2010-11-27 22:19     ` Wolfgang Denk
2010-11-24 12:07   ` Thomas Weber [this message]
2010-11-27 22:19     ` [U-Boot] [RFC/PATCHv2 2/2] Common/cmd_nvedit: Check for env subcommand Wolfgang Denk
2010-11-24 12:44 ` [U-Boot] [RFC/PATCH] common/command.c: Guard strchr/strlen from NULL pointer Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1290600472-23147-2-git-send-email-weber@corscience.de \
    --to=weber@corscience.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.