removed prog. Use err & c:o

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1525 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-03-30 16:47:20 +00:00
parent b954e41c07
commit 6a51a28699

View File

@@ -40,14 +40,12 @@
RCSID("$Id$"); RCSID("$Id$");
char *prog;
static void static void
usage (void) usage (void)
{ {
fprintf(stderr, fprintf(stderr,
"Usage: %s [-e] [-h] [-n count] [-f alg] num seed\n", "Usage: %s [-e] [-h] [-n count] [-f alg] num seed\n",
prog); __progname);
exit (1); exit (1);
} }
@@ -93,7 +91,7 @@ main (int argc, char **argv)
void (*fn)(OtpKey, char *); void (*fn)(OtpKey, char *);
OtpAlgorithm *alg = otp_find_alg (OTP_ALG_DEFAULT); OtpAlgorithm *alg = otp_find_alg (OTP_ALG_DEFAULT);
prog = argv[0]; set_progname (argv[0]);
while ((c = getopt (argc, argv, "ehn:f:")) != EOF) while ((c = getopt (argc, argv, "ehn:f:")) != EOF)
switch (c) { switch (c) {
@@ -108,10 +106,8 @@ main (int argc, char **argv)
break; break;
case 'f' : case 'f' :
alg = otp_find_alg (optarg); alg = otp_find_alg (optarg);
if (alg == NULL) { if (alg == NULL)
fprintf (stderr, "%s: Unknown algorithm: %s\n", prog, optarg); errx(1, "Unknown algorithm: %s", optarg);
return 1;
}
break; break;
default : default :
usage (); usage ();