diff options
author | mestre <mestre@openbsd.org> | 2016-03-07 12:07:55 +0000 |
---|---|---|
committer | mestre <mestre@openbsd.org> | 2016-03-07 12:07:55 +0000 |
commit | 6fa5e1da3490487b9d3a614457ba0b7c041eb1ac (patch) | |
tree | af9e82e34d5b4e7a5706072e56af61f31d6a768f /games/factor | |
parent | boolean_t/FALSE/TRUE -> int/0/1 (diff) | |
download | wireguard-openbsd-6fa5e1da3490487b9d3a614457ba0b7c041eb1ac.tar.xz wireguard-openbsd-6fa5e1da3490487b9d3a614457ba0b7c041eb1ac.zip |
- General changes:
- Remove -? from getopt(3) options, but still keep (or add) -h where applicable
- Replace hardcoded program strings by getprogname(3)
- Specific changes:
- atc(6): this used -? and -u for usage(), remove both from game and manpage
- bcd(6): use __progname instead of getprogname(3), no need to include stdlib.h
- hunt(6): replace fputs(3) by fprintf(3)
OK tb@ after his suggestions
Diffstat (limited to 'games/factor')
-rw-r--r-- | games/factor/factor.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/games/factor/factor.c b/games/factor/factor.c index d7457c42bad..fc86828ca25 100644 --- a/games/factor/factor.c +++ b/games/factor/factor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: factor.c,v 1.26 2016/01/07 16:00:32 tb Exp $ */ +/* $OpenBSD: factor.c,v 1.27 2016/03/07 12:07:56 mestre Exp $ */ /* $NetBSD: factor.c,v 1.5 1995/03/23 08:28:07 cgd Exp $ */ /* @@ -88,9 +88,9 @@ main(int argc, char *argv[]) if (pledge("stdio", NULL) == -1) err(1, "pledge"); - while ((ch = getopt(argc, argv, "")) != -1) { + while ((ch = getopt(argc, argv, "h")) != -1) { switch (ch) { - case '?': + case 'h': default: usage(); } @@ -286,6 +286,6 @@ pr_bigfact(u_int64_t val) /* Factor this value. */ void usage(void) { - (void)fprintf(stderr, "usage: factor [number ...]\n"); + (void)fprintf(stderr, "usage: %s [number ...]\n", getprogname()); exit (1); } |