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/.
Harald Welte gerrit-no-reply at lists.osmocom.orgHarald Welte has submitted this change and it was merged.
Change subject: db-tool: error-exit on too many arguments
......................................................................
db-tool: error-exit on too many arguments
Each arg parsing should increment optind, so if there are any surplus args in
the end, that's an error.
Change-Id: I9fc0a87d11db8c35061568e3f8b5a5547931a961
---
M src/hlr_db_tool.c
1 file changed, 6 insertions(+), 0 deletions(-)
Approvals:
Harald Welte: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/hlr_db_tool.c b/src/hlr_db_tool.c
index fb10f3e..d8a3584 100644
--- a/src/hlr_db_tool.c
+++ b/src/hlr_db_tool.c
@@ -159,6 +159,12 @@
print_help();
exit(EXIT_FAILURE);
}
+
+ if (argc - optind > 0) {
+ fprintf(stderr, "Too many arguments: '%s'\n", argv[optind]);
+ print_help();
+ exit(EXIT_FAILURE);
+ }
}
static void signal_hdlr(int signal)
--
To view, visit https://gerrit.osmocom.org/4778
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9fc0a87d11db8c35061568e3f8b5a5547931a961
Gerrit-PatchSet: 2
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder