From c17641d483279151748dc7cec8e9e44b0da11623 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Mon, 5 Dec 2016 18:35:21 +0100 Subject: tools: Fix issues in irm bind/unbind Fixes a segmentation fault in irm unbind api when no pid is specified and improves the help information for bind/unbind. --- src/tools/irm/irm_bind.c | 1 + src/tools/irm/irm_unbind.c | 1 + src/tools/irm/irm_unbind_ap.c | 3 ++- src/tools/irm/irm_unbind_api.c | 5 +++-- src/tools/irm/irm_unbind_ipcp.c | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src/tools') diff --git a/src/tools/irm/irm_bind.c b/src/tools/irm/irm_bind.c index aafa2f75..2b5a6cf4 100644 --- a/src/tools/irm/irm_bind.c +++ b/src/tools/irm/irm_bind.c @@ -31,6 +31,7 @@ static void usage(void) { printf("Usage: irm bind [OPERATION]\n" + "\n" "where OPERATION = {ap api ipcp help}\n"); } diff --git a/src/tools/irm/irm_unbind.c b/src/tools/irm/irm_unbind.c index a6b27907..962e9555 100644 --- a/src/tools/irm/irm_unbind.c +++ b/src/tools/irm/irm_unbind.c @@ -31,6 +31,7 @@ static void usage(void) { printf("Usage: irm unbind [OPERATION]\n" + "\n" "where OPERATION = {ap api ipcp help}\n"); } diff --git a/src/tools/irm/irm_unbind_ap.c b/src/tools/irm/irm_unbind_ap.c index 8ad3d670..f3f16ee1 100644 --- a/src/tools/irm/irm_unbind_ap.c +++ b/src/tools/irm/irm_unbind_ap.c @@ -32,7 +32,8 @@ static void usage(void) { printf("Usage: irm unbind ap \n" - " [name , omit: remove all AP info]\n"); + " [name (default: remove all AP info)]" + "\n"); } int do_unbind_ap(int argc, char ** argv) diff --git a/src/tools/irm/irm_unbind_api.c b/src/tools/irm/irm_unbind_api.c index d332f438..fdfc2374 100644 --- a/src/tools/irm/irm_unbind_api.c +++ b/src/tools/irm/irm_unbind_api.c @@ -33,7 +33,8 @@ static void usage(void) { printf("Usage: irm unbind api \n" - " [name , omit: remove all AP-I info]\n"); + " [name (default: remove all AP-I info)]" + "\n"); } int do_unbind_api(int argc, char ** argv) @@ -41,7 +42,7 @@ int do_unbind_api(int argc, char ** argv) pid_t api = -1; char * name = NULL; - while (argc > 0) { + while (argc > 1) { if (matches(*argv, "name") == 0) { name = *(argv + 1); ++argv; diff --git a/src/tools/irm/irm_unbind_ipcp.c b/src/tools/irm/irm_unbind_ipcp.c index 33d7a818..16dd024b 100644 --- a/src/tools/irm/irm_unbind_ipcp.c +++ b/src/tools/irm/irm_unbind_ipcp.c @@ -33,7 +33,8 @@ static void usage(void) { printf("Usage: irm unbind ipcp \n" - " [name , omit: remove all information.\n"); + " [name (default: remove all IPCP info)]" + "\n"); } int do_unbind_ipcp(int argc, char ** argv) -- cgit v1.2.3