commit - e9952e5924b7a0cb62697d5a008476ab4bd6dd3f
commit + 56fdb92d3c609bfe29de12cc4a6ecd2ef03c920f
blob - bc8333b2af521341546986741038fce75ff0b706
blob + f447d1bc8ffad6facb7f8424555b091cd0781764
--- gpass.c
+++ gpass.c
#include <limits.h>
#include <math.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <stdio.h>
#include <strings.h>
#include <unistd.h>
#define PREFIX "/usr/local"
#endif
-char *pgen, *dictname = NULL;
+char *dictname = NULL;
int plen = 70, nlines = 0, npass = 1;
FILE *dictfp;
int
usage(void)
{
- fprintf(stderr, "%s [-d dict] [-e bits] [-n count]\n", pgen);
+ fprintf(stderr, "%s [-d dict] [-e bits] [-n count]\n", getprogname());
exit(EXIT_FAILURE);
}
int
main(int argc, char *argv[])
{
- pgen = argv[0];
if (sodium_init() < 0)
err(1, "libsodium");
+
int c;
while ((c = getopt(argc, argv, "d:e:n:")) != -1) {
switch (c) {
for (int i = 0; i < npass; i++)
gen();
fclose(dictfp);
+
+ return 0;
}