On Fri, Oct 09, 2015 at 03:10:38AM -0400, Michael Reed wrote:
> The argument passed to usage() was always the same (argv[0]), so
> this patch removes the parameter and uses __progname instead.
> The usage message was misaligned, so I fixed that as well.
> 

A few style(9) nits inline

> Index: skey.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/skey/skey.c,v
> retrieving revision 1.28
> diff -u -p -r1.28 skey.c
> --- skey.c    18 Apr 2015 18:28:38 -0000      1.28
> +++ skey.c    9 Oct 2015 07:01:27 -0000
> @@ -30,7 +30,7 @@
>  #include <limits.h>
>  #include <skey.h>
>  
> -void    usage(char *);
> +void __dead usage(void);

Shouldn't that be

__dead void usage();

At least that's what it is throughout usr.bin

> @@ -147,10 +147,13 @@ main(int argc, char *argv[])
>  }
>  
>  void
> -usage(char *s)
> +usage(void)

Almost all programs in usr.bin repeat the __dead attribute:

__dead void
usage(void)

>  {
> +     extern char *__progname;
> +
>       fprintf(stderr,
> -         "usage: %s [-x] [-md5 | -rmd160 | -sha1] [-n count]\n\t"
> -         "[-p passphrase] <sequence#>[/] key\n", s);
> +             "usage: %s [-x] [-md5 | -rmd160 | -sha1] [-n count]\n"
> +             "            [-p passphrase] <sequence#>[/] key\n",
> +             __progname);

The secondary indentation should be four spaces, according to style(9)

Reply via email to