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

pespin gerrit-no-reply at lists.osmocom.org
Fri Jun 14 10:46:57 UTC 2019


pespin has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/47/14447/1

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190614/5e57e599/attachment.html>


More information about the gerrit-log mailing list