Organised output

This commit is contained in:
Aram
2016-05-03 08:29:55 +02:00
parent c610829f2a
commit 2f47e0424b

View File

@ -288,7 +288,9 @@ POSSIBILITY OF SUCH DAMAGES.
#include <signal.h> #include <signal.h>
#include <pthread.h> #include <pthread.h>
#include <fcntl.h> #include <fcntl.h>
#ifndef __WIN32
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#endif
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <math.h> #include <math.h>
@ -523,12 +525,10 @@ void notify_status_offline(int sig){
} }
void notify_status_online(int sig){ void notify_status_online(int sig){
if(!space){ if(!total_states){
printf(VT100_cleareol "Collected %zu nonces... ", nonces_collected); printf(VT100_cleareol "Collected %zu nonces... ", nonces_collected);
} else { } else {
printf(VT100_cleareol "Collected %zu nonces... leftover complexity %zu (~2^%0.2f)", nonces_collected, total_states, log(total_states) / log(2)); printf(VT100_cleareol "Collected %zu nonces... leftover complexity %zu (~2^%0.2f)", nonces_collected, total_states, log(total_states) / log(2));
}
if(total_states){
char c; char c;
if(scanf("%c", &c) == 1 || total_states < CUTOFF){ if(scanf("%c", &c) == 1 || total_states < CUTOFF){
printf(" - initializing brute-force phase...\n"); printf(" - initializing brute-force phase...\n");