From 6a51a286991b6c12a2a406a468029bc4f993c54a Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 30 Mar 1997 16:47:20 +0000 Subject: [PATCH] removed prog. Use err & c:o git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1525 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/otp/otpprint.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/appl/otp/otpprint.c b/appl/otp/otpprint.c index c8d34a837..289166738 100644 --- a/appl/otp/otpprint.c +++ b/appl/otp/otpprint.c @@ -40,14 +40,12 @@ RCSID("$Id$"); -char *prog; - static void usage (void) { fprintf(stderr, "Usage: %s [-e] [-h] [-n count] [-f alg] num seed\n", - prog); + __progname); exit (1); } @@ -93,7 +91,7 @@ main (int argc, char **argv) void (*fn)(OtpKey, char *); OtpAlgorithm *alg = otp_find_alg (OTP_ALG_DEFAULT); - prog = argv[0]; + set_progname (argv[0]); while ((c = getopt (argc, argv, "ehn:f:")) != EOF) switch (c) { @@ -108,10 +106,8 @@ main (int argc, char **argv) break; case 'f' : alg = otp_find_alg (optarg); - if (alg == NULL) { - fprintf (stderr, "%s: Unknown algorithm: %s\n", prog, optarg); - return 1; - } + if (alg == NULL) + errx(1, "Unknown algorithm: %s", optarg); break; default : usage ();