Skip to contentSkip to conversation

tools: terminate getopt_long long option arrays properly

PATCH New Jani Nikula 1 participant 1 message Oct 1, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: terminate getopt_long long option arrays properly

The last element of the long options array has to be filled with zeros.

---
 tools/intel_dump_decode.c | 3 ++-
 tools/intel_infoframes.c  | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
tools/intel_dump_decode.c +2 -1
index a8dcca068bf2..0341aada4016 100644
@@ -166,7 +166,8 @@ main (int argc, char *argv[])
 	static struct option long_options[] = {
 		{"devid", 1, 0, 'd'},
 		{"ascii", 0, 0, 'a'},
-		{"binary", 0, 0, 'b'}
+		{"binary", 0, 0, 'b'},
+		{ 0 }
 	};
 
 	devid_str = getenv("INTEL_DEVID_OVERRIDE");
tools/intel_infoframes.c +1 -0
index e838fddfc963..e03cb2c06a52 100644
@@ -1101,6 +1101,7 @@ int main(int argc, char *argv[])
 		{ "transcoder" ,        required_argument, NULL, 't' },
 		{ "infoframe",          required_argument, NULL, 'f' },
 		{ "help",               no_argument,       NULL, 'h' },
+		{ 0 }
 	};
 
 	printf("WARNING: This is just a debugging tool! Don't expect it to work"
Signature · 1 line
1.9.1