summaryrefslogtreecommitdiff
path: root/lib/command.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-05-12 09:16:23 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-05-13 13:08:00 -0400
commitdfdbe7e4b0340c46cd8338e7e44e6bfa5f52e933 (patch)
tree64cb2a0ba15905c7f8f4fc119332bb97891fe482 /lib/command.c
parent8d7bba28749d767d12190b8a84b7b78b6397c971 (diff)
lib: Cleanup command parsing a tiny bit
The CLI changes now make it impossible for numbers outside the range specified in the cli to make it to this code. No need to check for it again. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/command.c b/lib/command.c
index 03092ed184..2b8eee8de3 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2117,16 +2117,8 @@ DEFUN (config_terminal_length,
"Number of lines on screen (0 for no pausing)\n")
{
int idx_number = 2;
- int lines;
- char *endptr = NULL;
- lines = strtol (argv[idx_number]->arg, &endptr, 10);
- if (lines < 0 || lines > 512 || *endptr != '\0')
- {
- vty_out (vty, "length is malformed%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- vty->lines = lines;
+ vty->lines = atoi (argv[idx_number]->arg);
return CMD_SUCCESS;
}
@@ -2150,16 +2142,8 @@ DEFUN (service_terminal_length,
"Number of lines of VTY (0 means no line control)\n")
{
int idx_number = 2;
- int lines;
- char *endptr = NULL;
- lines = strtol (argv[idx_number]->arg, &endptr, 10);
- if (lines < 0 || lines > 512 || *endptr != '\0')
- {
- vty_out (vty, "length is malformed%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- host.lines = lines;
+ host.lines = atoi (argv[idx_number]->arg);
return CMD_SUCCESS;
}