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_unbind_api.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/tools/irm/irm_unbind_api.c') 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; -- cgit v1.2.3