diff --git a/cli/main.c b/cli/main.c index a2a4e20..98a6765 100644 --- a/cli/main.c +++ b/cli/main.c @@ -81,19 +81,19 @@ static void signal_handler(int signum) static void display_password(char* password, int time) { - int length; + int print_len = 0; for (; time && !s_stop_display; time--) { - printf("\r(%02d) Password found: %s", time, password); + print_len = printf("\r(%02d) Password found: %s", time, password); fflush(stdout); sleep(1); } // Clear line + print_len++; // For C or Z printf("\r"); - length = 4 + 17 + strlen(password) + 1 + 1 /* For Ctrl+Z/C */; - while (length--) + while (print_len--) printf(" "); printf("\n"); }