Explorar o código

Add a zeroed final option for getopt_long for correctness

Marc Di Luzio %!s(int64=5) %!d(string=hai) anos
pai
achega
41d35fa12a
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      daemon/main.c

+ 2 - 1
daemon/main.c

@@ -114,7 +114,8 @@ int main(int argc, char *argv[])
 		                                    { "test", no_argument, 0, 't' },
 		                                    { "status", optional_argument, 0, 's' },
 		                                    { "help", no_argument, 0, 'h' },
-		                                    { "version", no_argument, 0, 'v' } };
+		                                    { "version", no_argument, 0, 'v' },
+		                                    { NULL, 0, NULL, 0 }, };
 	static const char *short_options = "dls::r::tvh";
 
 	while ((opt = getopt_long(argc, argv, short_options, long_options, 0)) != -1) {