From 68b907a012922e7581501834ef472d83a9ed694e Mon Sep 17 00:00:00 2001 From: jsteube Date: Wed, 26 Oct 2016 14:42:19 +0200 Subject: [PATCH] Fix some output in case wordlist has only size of 1 word --- src/wordlist.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/wordlist.c b/src/wordlist.c index 30476325e..89c7ac5a1 100644 --- a/src/wordlist.c +++ b/src/wordlist.c @@ -405,15 +405,18 @@ u64 count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile) double percent = ((double) comp / (double) d.stat.st_size) * 100; - cache_generate_t cache_generate; + if (percent < 100) + { + cache_generate_t cache_generate; - cache_generate.dictfile = (char *) dictfile; - cache_generate.comp = comp; - cache_generate.percent = percent; - cache_generate.cnt = cnt; - cache_generate.cnt2 = cnt2; + cache_generate.dictfile = (char *) dictfile; + cache_generate.comp = comp; + cache_generate.percent = percent; + cache_generate.cnt = cnt; + cache_generate.cnt2 = cnt2; - EVENT_DATA (EVENT_WORDLIST_CACHE_GENERATE, &cache_generate, sizeof (cache_generate)); + EVENT_DATA (EVENT_WORDLIST_CACHE_GENERATE, &cache_generate, sizeof (cache_generate)); + } } cache_generate_t cache_generate;