summaryrefslogtreecommitdiff
path: root/lib/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/command.c b/lib/command.c
index f51b2c69ee..96ce661e4a 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -738,10 +738,6 @@ cmd_execute_command_real (vector vline,
case MATCHER_AMBIGUOUS:
return CMD_ERR_AMBIGUOUS;
default:
- {} // C...
- char *inputline = cmd_concat_strvec (vline);
- zlog_err ("invalid command \"%s\" for node %d\n", inputline, vty->node);
- free (inputline);
return CMD_ERR_NO_MATCH;
}
@@ -909,10 +905,12 @@ command_config_read_one_line (struct vty *vty, struct cmd_element **cmd, int use
ret != CMD_WARNING)
{
vty->node = saved_node;
- memcpy(vty->error_buf, vty->buf, VTY_BUFSIZ);
}
}
+ if (ret != CMD_SUCCESS && ret != CMD_WARNING)
+ memcpy (vty->error_buf, vty->buf, VTY_BUFSIZ);
+
cmd_free_strvec (vline);
return ret;