rockchip: rk3188: fix early uart setup
[oweals/u-boot.git] / common / command.c
index e5d9b9cf959c913304348f7147bb57f72ab53934..2433a89e0a8e10f3098eb453e25db33f574436f5 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2000-2009
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -318,7 +317,7 @@ static int find_common_prefix(char * const argv[])
        return len;
 }
 
-static char tmp_buf[CONFIG_SYS_CBSIZE];        /* copy of console I/O buffer   */
+static char tmp_buf[CONFIG_SYS_CBSIZE + 1];    /* copy of console I/O buffer */
 
 int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *colp)
 {
@@ -548,10 +547,13 @@ enum command_ret_t cmd_process(int flag, int argc, char * const argv[],
 
 int cmd_process_error(cmd_tbl_t *cmdtp, int err)
 {
+       if (err == CMD_RET_USAGE)
+               return CMD_RET_USAGE;
+
        if (err) {
                printf("Command '%s' failed: Error %d\n", cmdtp->name, err);
-               return 1;
+               return CMD_RET_FAILURE;
        }
 
-       return 0;
+       return CMD_RET_SUCCESS;
 }