summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-06-14 12:38:42 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-06-14 12:38:44 +0200
commitc17c6d6ea550b2c0fe1e58d5ea69d39c0b8e4a8c (patch)
tree51663c1748d9536115ec735538603a7fa8bc1cad /src
parentcc794e993c88677b4d7265a68fabab21ccc4baab (diff)
command.c: Improve return check condition in cmd_execut_command_real()
Check against MAX argc is changed to == since it cannot be incremented twice without passing the check. Change-Id: Ia330e475989fda863bedcc3cbf94deaf8dd83037
Diffstat (limited to 'src')
-rw-r--r--src/vty/command.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vty/command.c b/src/vty/command.c
index 4189c7c0..b26e9919 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -2313,7 +2313,7 @@ cmd_execute_command_real(vector vline, struct vty *vty,
argv[argc++] = vector_slot(vline, i);
}
- if (argc >= CMD_ARGC_MAX)
+ if (argc == CMD_ARGC_MAX)
return CMD_ERR_EXEED_ARGC_MAX;
}
@@ -2458,7 +2458,7 @@ cmd_execute_command_strict(vector vline, struct vty *vty,
argv[argc++] = vector_slot(vline, i);
}
- if (argc >= CMD_ARGC_MAX)
+ if (argc == CMD_ARGC_MAX)
return CMD_ERR_EXEED_ARGC_MAX;
}