Change in libosmocore[master]: vty/tdef_vty.c: drop redundant comparison

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Mar 19 13:44:58 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13019 )

Change subject: vty/tdef_vty.c: drop redundant comparison
......................................................................

vty/tdef_vty.c: drop redundant comparison

The amount of arguments is already being checked a few lines before:

  /* If any arguments are missing, redirect to 'show' */
  if (argc < 3)
    return show_timer(self, vty, argc, argv);

so we cannot reach the expression NULL inside this statement:

  group_arg = argc > 0 ? argv[0] : NULL;

Change-Id: Ice59d1a46c2080cd02060e3410706c502db4ce0b
Fixes: CID#190873 Logically dead code (DEADCODE)
---
M src/vty/tdef_vty.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Max: Looks good to me, approved
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/vty/tdef_vty.c b/src/vty/tdef_vty.c
index 04c14b9..28de21a 100644
--- a/src/vty/tdef_vty.c
+++ b/src/vty/tdef_vty.c
@@ -287,7 +287,7 @@
 		return show_timer(self, vty, argc, argv);
 
 	/* If all arguments are passed, this is configuring a timer. */
-	group_arg = argc > 0 ? argv[0] : NULL;
+	group_arg = argv[0];
 	timer_args = argv + 1;
 	osmo_tdef_groups_for_each(g, global_tdef_groups) {
 		if (strcmp(g->name, group_arg))

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ice59d1a46c2080cd02060e3410706c502db4ce0b
Gerrit-Change-Number: 13019
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190319/74077ed6/attachment.html>


More information about the gerrit-log mailing list