sigchk

sign and check files using ed25519
git clone git://z3bra.org/sick
Log | Files | Refs | Submodules | README | LICENSE

commit fe15d474478f90ff330ce50b699b034a6f03fdba
parent eda71827483790d76060445b9bf13ca6101faa0a
Author: z3bra <willyatmailoodotorg>
Date:   Mon May  2 23:48:24 2016

Make argv0 global

Diffstat:
 sick.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/sick.c b/sick.c @@ -29,7 +29,8 @@ enum { ACTION_DEFAULT = ACTION_CHECK }; -void usage(const char *name); + +void usage(); char *base_name(char *path); int check_magic(const char *file); @@ -40,12 +41,13 @@ int sign(const char *file, const char *key); int verify(const char *file, const char *key); int check(const char *file, char *keyring); +char *argv0 = NULL; int verbose = 0; void -usage(const char *name) +usage() { - fprintf(stderr, "usage: %s [-f key] [-cgsuv] [file]\n", name); + fprintf(stderr, "usage: %s [-f key] [-cgsuv] [file]\n", argv0); exit(1); } @@ -339,7 +341,7 @@ int main(int argc, char **argv) { int action = ACTION_DEFAULT; - const char *argv0 = NULL, *key = NULL; + const char *key = NULL; char keyring[PATH_MAX]; memset(keyring, 0, PATH_MAX); @@ -366,7 +368,7 @@ main(int argc, char **argv) verbose = 1; break; default: - usage(argv0); + usage(); }ARGEND; switch(action) { @@ -394,7 +396,7 @@ main(int argc, char **argv) } break; default: - usage(argv0); + usage(); } return 0;