]> git.sur5r.net Git - u-boot/commitdiff
Common/cmd_nvedit: Check for env subcommand
authorThomas Weber <weber@corscience.de>
Wed, 24 Nov 2010 12:07:52 +0000 (13:07 +0100)
committerWolfgang Denk <wd@denx.de>
Sat, 27 Nov 2010 22:35:13 +0000 (23:35 +0100)
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

index 3fd8abc157f98f4f67326a90ceea5acbe6a77d25..52c5e7c30d755e6513f3f8445182cbd30709b1fd 100644 (file)
@@ -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++;