fix logic/usage in VERIFYONLY case
authorespie <espie@openbsd.org>
Wed, 8 Jan 2014 07:04:29 +0000 (07:04 +0000)
committerespie <espie@openbsd.org>
Wed, 8 Jan 2014 07:04:29 +0000 (07:04 +0000)
okay deraadt@

usr.bin/signify/signify.c

index 3d66818..72ffdcc 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: signify.c,v 1.14 2014/01/08 05:00:01 tedu Exp $ */
+/* $OpenBSD: signify.c,v 1.15 2014/01/08 07:04:29 espie Exp $ */
 /*
  * Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
  *
@@ -70,10 +70,15 @@ static void
 usage(void)
 {
        fprintf(stderr, "usage:"
+#ifndef VERIFYONLY
            "\t%s [-n] -p pubkey -s seckey -G\n"
            "\t%s [-o output] -s seckey -S input\n"
+#endif
            "\t%s [-o output] -p pubkey -V input\n",
-           __progname, __progname, __progname);
+#ifndef VERIFYONLY
+           __progname, __progname, 
+#endif
+           __progname);
        exit(1);
 }
 
@@ -403,7 +408,11 @@ main(int argc, char **argv)
        argc -= optind;
        argv += optind;
 
+#ifdef VERIFYONLY
+       if (verb != VERIFY)
+#else
        if (verb == NONE)
+#endif
                usage();
 
 #ifndef VERIFYONLY