From 40e29aec791295652bb0cfc3dda0a47499b71384 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 17 Apr 2018 02:03:44 +0200 Subject: tools: Fix help information for irm ipcp The new command 'irm ipcp list' was not being printed upon printing the usage of 'irm ipcp'. It also fixes an unchecked return value. Signed-off-by: Sander Vrijders Signed-off-by: Dimitri Staessens --- src/tools/irm/irm_ipcp.c | 3 ++- src/tools/irm/irm_register.c | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/tools') diff --git a/src/tools/irm/irm_ipcp.c b/src/tools/irm/irm_ipcp.c index 89aa4145..72e32805 100644 --- a/src/tools/irm/irm_ipcp.c +++ b/src/tools/irm/irm_ipcp.c @@ -46,7 +46,8 @@ static void usage(void) printf("Usage: irm ipcp [OPERATION]\n\n" "where OPERATION = {create destroy\n" " bootstrap enroll\n" - " connect disconnect help}\n"); + " connect disconnect\n" + " list help}\n"); } static int do_help(int argc, char **argv) diff --git a/src/tools/irm/irm_register.c b/src/tools/irm/irm_register.c index 59d65a69..23c65f7d 100644 --- a/src/tools/irm/irm_register.c +++ b/src/tools/irm/irm_register.c @@ -72,8 +72,9 @@ int do_register(int argc, char * ipcp[MAX_IPCPS]; size_t ipcp_len = 0; struct ipcp_info * ipcps; - size_t len; - size_t i; + ssize_t len; + ssize_t i; + while (argc > 0) { if (matches(*argv, "name") == 0) { @@ -106,6 +107,9 @@ int do_register(int argc, } len = irm_list_ipcps(&ipcps); + if (len < 0) + return len; + for (i = 0; i < len; ++i) { size_t j; for (j = 0; j < layers_len; j++) { -- cgit v1.2.3