Change in ...libosmocore[master]: command.c: Improve return check condition in cmd_execut_command_real()

laforge gerrit-no-reply at lists.osmocom.org
Fri Jun 14 21:54:03 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/libosmocore/+/14447 )

Change subject: command.c: Improve return check condition in cmd_execut_command_real()
......................................................................

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
---
M src/vty/command.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/vty/command.c b/src/vty/command.c
index 4189c7c..b26e991 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -2313,7 +2313,7 @@
 				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 @@
 				argv[argc++] = vector_slot(vline, i);
 		}
 
-		if (argc >= CMD_ARGC_MAX)
+		if (argc == CMD_ARGC_MAX)
 			return CMD_ERR_EXEED_ARGC_MAX;
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/14447
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia330e475989fda863bedcc3cbf94deaf8dd83037
Gerrit-Change-Number: 14447
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190614/eb671fa5/attachment.html>


More information about the gerrit-log mailing list