Explorar el Código

Common/cmd_nvedit: Check for env subcommand

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

Signed-off-by: Thomas Weber <weber@corscience.de>
Thomas Weber hace 14 años
padre
commit
5904da0214
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      common/cmd_nvedit.c

+ 3 - 0
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++;