Commit 7c73a3b0 authored by Niels Möller's avatar Niels Möller

* testsuite/des-compat-test.c: Don't include <unistd.h>.

* testsuite/testutils.c (main): Don't use getopt. Then we don't
need to include <unistd.h>.

Rev: src/nettle/testsuite/des-compat-test.c:1.6
Rev: src/nettle/testsuite/testutils.c:1.26
parent 8d7504b9
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <string.h> #include <string.h>
#include "des-compat.h" #include "des-compat.h"
......
...@@ -10,9 +10,6 @@ ...@@ -10,9 +10,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
/* For getopt() */
#include <unistd.h>
/* -1 means invalid */ /* -1 means invalid */
static const signed char hex_digits[0x100] = static const signed char hex_digits[0x100] =
{ {
...@@ -147,24 +144,17 @@ int verbose = 0; ...@@ -147,24 +144,17 @@ int verbose = 0;
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
int c; if (argc > 1)
{
while ((c = getopt (argc, argv, "v")) != -1) if (argc == 2 && strcmp(argv[1], "-v"))
switch (c)
{
case 'v':
verbose = 1; verbose = 1;
break; else
case '?': {
if (isprint (optopt)) fprintf(stderr, "Invalid argument `%s', only accepted option is `-v'.\n",
fprintf (stderr, "Unknown option `-%c'.\n", optopt); argv[1]);
else return 1;
fprintf (stderr, }
"Unknown option character `\\x%x'.\n", }
optopt);
default:
abort();
}
return test_main(); return test_main();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment