Skip to contentSkip to conversation

monitor: Fix optstring to parse -b parameter

PATCH Applied Anton Weber 4 participants 4 messages Jun 15, 2012 – Jun 28, 2012 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 monitor: Fix optstring to parse -b parameter

Without the colon getopt ignores the parameter and optarg is always NULL.

---
 monitor/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
monitor/main.c +1 -1
index 90e32c5..0b8ae30 100644
@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
 	for (;;) {
 		int opt;
 
-		opt = getopt_long(argc, argv, "bvh", main_options, NULL);
+		opt = getopt_long(argc, argv, "b:vh", main_options, NULL);
 		if (opt < 0)
 			break;
 
Signature · 1 line
1.7.5.4
#1 lore raw

Hi Anton,

Quoted 4 lines · Anton Weber

Without the colon getopt ignores the parameter and optarg is always NULL.
---
 monitor/main.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)

I tested your patch and it fixed -b option for me.

Best Regards,

Signature · 3 lines
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
#2 lore raw
In reply to Anton Weber

Hi Anton,

Quoted 10 lines · Anton Weber

Without the colon getopt ignores the parameter and optarg is always NULL.

---
 monitor/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
monitor/main.c +0 -0
index 90e32c5..0b8ae30 100644

monitor/main.c int main(int argc, char *argv[]) · line 78

Quoted 7 lines
monitor/main.c +1 -1
@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
 	for (;;) {
 		int opt;
 
-		opt = getopt_long(argc, argv, "bvh", main_options, NULL);
+		opt = getopt_long(argc, argv, "b:vh", main_options, NULL);
 		if (opt < 0)
 			break;

Ack.

Gustavo

#3 lore raw
In reply to Anton Weber

Hi Anton,

Quoted 4 lines · Anton Weber

Without the colon getopt ignores the parameter and optarg is always NULL.

---
 monitor/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied. Thanks.

Johan