All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] shell: Set empty argument if optarg is NULL
@ 2022-08-29 21:37 Luiz Augusto von Dentz
  2022-08-29 21:37 ` [PATCH BlueZ 2/2] client: Add -e/--endpoint option to auto register endpoints Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2022-08-29 21:37 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This sets enmpty string ("") when argument don't set any optarg so the
application can tell when an option was set or not.
---
 src/shared/shell.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/shared/shell.c b/src/shared/shell.c
index dfda8128af91..4658819a4bde 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -1158,7 +1158,7 @@ void bt_shell_init(int argc, char **argv, const struct bt_shell_opt *opt)
 				return;
 			}
 
-			*opt->optarg[index - offset] = optarg;
+			*opt->optarg[index - offset] = optarg ? : "";
 		}
 
 		index = -1;
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-30 21:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-29 21:37 [PATCH BlueZ 1/2] shell: Set empty argument if optarg is NULL Luiz Augusto von Dentz
2022-08-29 21:37 ` [PATCH BlueZ 2/2] client: Add -e/--endpoint option to auto register endpoints Luiz Augusto von Dentz
2022-08-29 22:30 ` [BlueZ,1/2] shell: Set empty argument if optarg is NULL bluez.test.bot
2022-08-30 21:30 ` [PATCH BlueZ 1/2] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.