diff options
author | Jim Meyering <jim@meyering.net> | 2004-01-21 23:06:51 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-01-21 23:06:51 +0000 |
commit | a86c7314d8d8f60210cafc16cf8fbbe7794f6008 (patch) | |
tree | ae9d7366107f0ac9504b2fc90c39941579024661 /src/factor.c | |
parent | b5189062ccf8379a9a153723075b6dc70c87bf78 (diff) | |
download | coreutils-a86c7314d8d8f60210cafc16cf8fbbe7794f6008.tar.xz |
(usage): Use EXIT_SUCCESS, not 0, for clarity.
(main): Do not report a usage error simply
because stdin has bad numbers.
Diffstat (limited to 'src/factor.c')
-rw-r--r-- | src/factor.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/factor.c b/src/factor.c index f10582692..305a958ae 100644 --- a/src/factor.c +++ b/src/factor.c @@ -1,5 +1,5 @@ /* factor -- print prime factors of n. - Copyright (C) 86, 1995-2003 Free Software Foundation, Inc. + Copyright (C) 86, 1995-2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -65,7 +65,7 @@ char *program_name; void usage (int status) { - if (status != 0) + if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name); else @@ -219,9 +219,9 @@ main (int argc, char **argv) int i; for (i = 1; i < argc; i++) fail |= print_factors (argv[i]); + if (fail) + usage (EXIT_FAILURE); } - if (fail) - usage (EXIT_FAILURE); - exit (fail); + exit (fail ? EXIT_FAILURE : EXIT_SUCCESS); } |