>From ee3b5b1a6884e1030578ca5131f2cac5e397a24f Mon Sep 17 00:00:00 2001 From: magnum Date: Thu, 3 Nov 2011 19:03:52 +0100 Subject: [PATCH] mute warnings from c3 when loading pot file --- src/c3_fmt.c | 1 + src/loader.c | 2 ++ src/options.h | 3 +++ 3 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/c3_fmt.c b/src/c3_fmt.c index e1fabf7..e01ed96 100644 --- a/src/c3_fmt.c +++ b/src/c3_fmt.c @@ -196,6 +196,7 @@ static int valid(char *ciphertext, struct fmt_main *pFmt) #ifdef HAVE_MPI if (mpi_id == 0) #endif + if (options.loadingpot == 0) fprintf(stderr, "Generic crypt(3) module: " "hash encoding string length %d, type id %c%c\n" "appears to be unsupported on this system; " diff --git a/src/loader.c b/src/loader.c index 31c6056..21442ef 100644 --- a/src/loader.c +++ b/src/loader.c @@ -579,6 +579,7 @@ static void ldr_load_pot_line(struct db_main *db, char *line) struct db_password *current; char *flds[10] = {0}; + options.loadingpot = 1; unprepared = ldr_get_field(&line, db->options->field_sep_char); flds[1] = unprepared; ciphertext = format->methods.prepare(flds, format); @@ -595,6 +596,7 @@ static void ldr_load_pot_line(struct db_main *db, char *line) !strcmp(current->source, ciphertext)) current->binary = NULL; } while ((current = current->next_hash)); + options.loadingpot = 0; } void ldr_load_pot_file(struct db_main *db, char *name) diff --git a/src/options.h b/src/options.h index 44959ae..d72a1d8 100644 --- a/src/options.h +++ b/src/options.h @@ -188,6 +188,9 @@ struct options_main { /* Forced min/max_keys_per_crypt (for testing purposes) */ int mkpc; + +/* Ugly flag to mute warnings from crypt format */ + int loadingpot; }; extern struct options_main options; -- 1.7.5.4