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 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "des-compat.h"
......
......@@ -10,9 +10,6 @@
#include <stdlib.h>
#include <string.h>
/* For getopt() */
#include <unistd.h>
/* -1 means invalid */
static const signed char hex_digits[0x100] =
{
......@@ -147,24 +144,17 @@ int verbose = 0;
int
main(int argc, char **argv)
{
int c;
while ((c = getopt (argc, argv, "v")) != -1)
switch (c)
{
case 'v':
if (argc > 1)
{
if (argc == 2 && strcmp(argv[1], "-v"))
verbose = 1;
break;
case '?':
if (isprint (optopt))
fprintf (stderr, "Unknown option `-%c'.\n", optopt);
else
fprintf (stderr,
"Unknown option character `\\x%x'.\n",
optopt);
default:
abort();
}
else
{
fprintf(stderr, "Invalid argument `%s', only accepted option is `-v'.\n",
argv[1]);
return 1;
}
}
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