Change in osmo-e1-recorder[master]: exit(2) on unsupported positional arguments on command line

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Dec 4 11:22:06 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1-recorder/+/16453 )

Change subject: exit(2) on unsupported positional arguments on command line
......................................................................

exit(2) on unsupported positional arguments on command line

Change-Id: I6d4efa6ddef41607aecd5ceee78e400db821292f
---
M src/e1_recorder.c
M src/e1cap_dump.c
2 files changed, 10 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/e1_recorder.c b/src/e1_recorder.c
index 9110ccb..d085ca5 100644
--- a/src/e1_recorder.c
+++ b/src/e1_recorder.c
@@ -123,6 +123,11 @@
 			break;
 		}
 	}
+
+	if (argc > optind) {
+		fprintf(stderr, "Unsupported positional arguments on command line\n");
+		exit(2);
+	}
 }
 
 int main(int argc, char **argv)
diff --git a/src/e1cap_dump.c b/src/e1cap_dump.c
index c172b55..73be84b 100644
--- a/src/e1cap_dump.c
+++ b/src/e1cap_dump.c
@@ -275,6 +275,11 @@
 		exit(2);
 	}
 
+	if (argc > optind+1) {
+		fprintf(stderr, "Unsupported positional arguments on command line\n");
+		exit(2);
+	}
+
 	f = osmo_e1cap_open(NULL, argv[optind++]);
 	if (!f) {
 		fprintf(stderr, "Unable to open input file\n");

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-e1-recorder/+/16453
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-e1-recorder
Gerrit-Branch: master
Gerrit-Change-Id: I6d4efa6ddef41607aecd5ceee78e400db821292f
Gerrit-Change-Number: 16453
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191204/a8a6186f/attachment.htm>


More information about the gerrit-log mailing list