shell: Fix return error in shell_execute_cmd

ENOEXEC should be used for executable file format error.
While is undertandable return it when the command is wrong, this
function is returning it two cases where other errors are more
descriptive. When parameter is NULL, is better return EINVAL.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2018-11-19 14:49:20 -08:00 committed by Anas Nashif
commit bc4cb76df5

View file

@ -1437,7 +1437,7 @@ int shell_execute_cmd(const struct shell *shell, const char *cmd)
}
if (cmd_len > (CONFIG_SHELL_CMD_BUFF_SIZE - 1)) {
return -ENOEXEC;
return -ENOMEM;
}
if (shell == NULL) {