From a3fa435f4faf03cd811bb60129f88d7c248d27c7 Mon Sep 17 00:00:00 2001 From: jsteube Date: Thu, 13 Oct 2016 19:44:22 +0200 Subject: [PATCH] Use \b instead a combination of \r and space --- src/main.c | 8 ++------ src/main_shared.c | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main.c b/src/main.c index 8ffcb8c0a..2f1aa25e1 100644 --- a/src/main.c +++ b/src/main.c @@ -33,14 +33,10 @@ static void main_log (hashcat_ctx_t *hashcat_ctx, FILE *fp) if (prev_len) { - fputc ('\r', fp); - for (int i = 0; i < prev_len; i++) { - fputc (' ', fp); + fputc ('\b', fp); } - - fputc ('\r', fp); } if (msg_newline == true) @@ -229,7 +225,7 @@ static void main_cracker_hash_cracked (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, if (outfile_ctx->fp != NULL) return; // cracked hash was not written to an outfile fwrite (buf, len, 1, stdout); - fwrite (EOL, sizeof (EOL), 1, stdout); + fwrite (EOL, strlen (EOL), 1, stdout); } static void main_calculated_words_base (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len) diff --git a/src/main_shared.c b/src/main_shared.c index 4d43c82fa..328165e8b 100644 --- a/src/main_shared.c +++ b/src/main_shared.c @@ -19,7 +19,7 @@ static void main_cracker_hash_cracked (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, if (outfile_ctx->fp != NULL) return; // cracked hash was not written to an outfile fwrite (buf, len, 1, stdout); - fwrite (EOL, sizeof (EOL), 1, stdout); + fwrite (EOL, strlen (EOL), 1, stdout); } void event (const u32 id, hashcat_ctx_t *hashcat_ctx, const void *buf, const size_t len)