summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/command.c20
-rw-r--r--lib/grammar_sandbox.c17
2 files changed, 7 insertions, 30 deletions
diff --git a/lib/command.c b/lib/command.c
index 03092ed18..2b8eee8de 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;
}
diff --git a/lib/grammar_sandbox.c b/lib/grammar_sandbox.c
index 97de94321..0da7981fc 100644
--- a/lib/grammar_sandbox.c
+++ b/lib/grammar_sandbox.c
@@ -588,7 +588,7 @@ pretty_print_dot (FILE *ofd, unsigned opts, struct graph_node *start,
return;
snprintf(tokennum, sizeof(tokennum), "%d?", tok->type);
- fprintf(ofd, " n%016llx [ shape=box, label=<", (unsigned long long)start);
+ fprintf(ofd, " n%p [ shape=box, label=<", start);
fprintf(ofd, "<b>%s</b>", LOOKUP_DEF(tokennames, tok->type, tokennum));
if (tok->attr == CMD_ATTR_DEPRECATED)
@@ -621,20 +621,13 @@ pretty_print_dot (FILE *ofd, unsigned opts, struct graph_node *start,
struct graph_node *adj = vector_slot (start->to, i);
// if this node is a vararg, just print *
if (adj == start) {
- fprintf(ofd, " n%016llx -> n%016llx;\n",
- (unsigned long long)start,
- (unsigned long long)start);
+ fprintf(ofd, " n%p -> n%p;\n", start, start);
} else if (((struct cmd_token *)adj->data)->type == END_TKN) {
//struct cmd_token *et = adj->data;
- fprintf(ofd, " n%016llx -> end%016llx;\n",
- (unsigned long long)start,
- (unsigned long long)adj);
- fprintf(ofd, " end%016llx [ shape=box, label=<end>, style = filled, fillcolor = \"#ffddaa\" ];\n",
- (unsigned long long)adj);
+ fprintf(ofd, " n%p -> end%p;\n", start, adj);
+ fprintf(ofd, " end%p [ shape=box, label=<end>, style = filled, fillcolor = \"#ffddaa\" ];\n", adj);
} else {
- fprintf(ofd, " n%016llx -> n%016llx;\n",
- (unsigned long long)start,
- (unsigned long long)adj);
+ fprintf(ofd, " n%p -> n%p;\n", start, adj);
size_t k;
for (k = 0; k < stackpos; k++)
if (stack[k] == adj)