]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: fix regression from c3ae785
authorJ William Piggott <elseifthen@gmx.com>
Tue, 18 Jul 2017 19:42:55 +0000 (15:42 -0400)
committerJ William Piggott <elseifthen@gmx.com>
Thu, 20 Jul 2017 00:48:10 +0000 (20:48 -0400)
hwclock --get foo
hwclock: 3 too many arguments given

Fixed:

hwclock --get foo
hwclock: 1 too many arguments given

Signed-off-by: J William Piggott <elseifthen@gmx.com>
sys-utils/hwclock.c

index 9745158a7b891d6c74403f70dbf82f330a83eaa3..aadf1964ad381514e026d772597f5f893e0f43d8 100644 (file)
@@ -1444,13 +1444,13 @@ int main(int argc, char **argv)
                case 'h':                       /* --help */
                        usage(&ctl);
                default:
-                       errtryhelp(EXIT_FAILURE);
+                       errtryhelp(EX_USAGE);
                }
        }
 
-       if (argc > optind) {
+       if (argc -= optind) {
                warnx(_("%d too many arguments given"), argc);
-               errtryhelp(EXIT_FAILURE);
+               errtryhelp(EX_USAGE);
        }
 
        if (!ctl.adj_file_name)