8 void usage(char *command) {
12 while ((c = strrchr(comm, '/')) != NULL) {
16 fprintf(stderr, "Usage: %s -d dictionary\n\n", comm);
17 fprintf(stderr, " -d dictionary file for cracklib\n\n");
18 fprintf(stderr, " The password is expected to be given via stdin.\n\n");
22 int main(int argc, char **argv) {
27 char *dictionary = NULL;
31 while ( (c = getopt(argc, argv, "d:")) != EOF){
34 dictionary = strdup(optarg);
41 if (dictionary == NULL) {
42 fprintf(stderr, "ERR - Wrong Command Line\n\n");
46 password = fgets(f, sizeof(f), stdin);
48 if (password == NULL) {
49 fprintf(stderr, "ERR - Failed to read password\n\n");
53 reply = FascistCheck(password, dictionary);
55 fprintf(stderr, "ERR - %s\n\n", reply);