Browse Source

Exit when invalid parameter is given.

Georgi Chorbadzhiyski 9 years ago
parent
commit
27b93c7db5
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      videohubctrl.c

+ 2
- 0
videohubctrl.c View File

70
 	// Set defaults
70
 	// Set defaults
71
 	data->dev_port = "9990";
71
 	data->dev_port = "9990";
72
 	while ((j = getopt_long(argc, argv, short_options, long_options, NULL)) != -1) {
72
 	while ((j = getopt_long(argc, argv, short_options, long_options, NULL)) != -1) {
73
+		if (j == '?') // Invalid parameter
74
+			exit(EXIT_FAILURE);
73
 		switch (j) {
75
 		switch (j) {
74
 			case 'h': // --host
76
 			case 'h': // --host
75
 				data->dev_host = optarg;
77
 				data->dev_host = optarg;

Loading…
Cancel
Save