X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fgenauth.c;h=b727eb6eb551aa6c553eb0ae4b10d43a4159861f;hp=895ed7bc64969e0d67c9a3baaed7902347f81fee;hb=803f908078e87f433727a3ddf2d61734e1ed9233;hpb=9c2ac77594d83a810c53faf6979e0b76006ecd0e diff --git a/src/genauth.c b/src/genauth.c index 895ed7bc..b727eb6e 100644 --- a/src/genauth.c +++ b/src/genauth.c @@ -1,6 +1,6 @@ /* genauth.c -- generate a random passphrase - Copyright (C) 1998,99 Ivo Timmermans + Copyright (C) 1998,1999,2000 Ivo Timmermans 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 @@ -35,12 +35,15 @@ int main(int argc, char **argv) int bits, c, i, bytes; unsigned char *p; - if(argc != 2) + if(argc > 2 || (argc == 2 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")))) { fprintf(stderr, "Usage: %s bits\n", argv[0]); return 1; } + if(!argv[1]) + argv[1] = "1024"; + if(!(bits = atol(argv[1]))) { fprintf(stderr, "Illegal number: %s\n", argv[1]);