--- pgp/src/getopt.c 2018/04/24 16:38:32 1.1.1.2 +++ pgp/src/getopt.c 2018/04/24 16:39:13 1.1.1.3 @@ -19,19 +19,15 @@ */ #include +#include +#include "getopt.h" /*LINTLIBRARY*/ #ifndef NULL #define NULL 0 #endif #define EOF (-1) -#define ERR(s, c) if(opterr){\ - extern int write();\ - char errbuf[2];\ - errbuf[0] = c; errbuf[1] = '\n';\ - (void) write(2, argv[0], (unsigned)strlen(argv[0]));\ - (void) write(2, s, (unsigned)strlen(s));\ - (void) write(2, errbuf, 2);} +#define ERR(str, chr) (opterr ? fprintf(stderr, "%s%s%c\n", argv[0], str, chr) : 0) int opterr = 1; int optind = 1; @@ -39,9 +35,7 @@ int optopt = 0; char *optarg = 0; int -getopt(argc, argv, opts) -int argc; -char **argv, *opts; +getopt(int argc, char **argv, char *opts) { static int sp = 1; register int c;