aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-04-30 20:40:00 +1200
committerDavid Phillips <david@sighup.nz>2017-04-30 20:40:00 +1200
commit275c518e6d6e5a1ca507cf36f7a7772cad681732 (patch)
tree417a8f467c5c13e6464a2319b6ce525b0ba026d3
parent6b4de44f04c0eed5a3cb997800d3f6d2d4a38605 (diff)
downloadsand-leek-275c518e6d6e5a1ca507cf36f7a7772cad681732.tar.xz
Improve output format
-rw-r--r--sand-leek.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sand-leek.c b/sand-leek.c
index 6cf5174..692d187 100644
--- a/sand-leek.c
+++ b/sand-leek.c
@@ -172,7 +172,7 @@ work(void *arg) {
goto STOP;
}
if(strncmp(onion, search, search_len) == 0) {
- printf("Found %s.onion\n", onion);
+ fprintf(stderr, "Found %s.onion\n", onion);
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
if (BN_set_word(bignum_e, e) != 1) {
@@ -190,7 +190,7 @@ work(void *arg) {
key_update_d(rsa_key);
if (RSA_check_key(rsa_key) == 1) {
- printf("Key valid\n");
+ fprintf(stderr, "Key valid\n");
EVP_PKEY *evp_key = EVP_PKEY_new();
if (!EVP_PKEY_assign_RSA(evp_key, rsa_key)) {
fprintf(stderr, "EVP_PKEY assignment failed\n");
@@ -207,7 +207,7 @@ work(void *arg) {
/* select next odd exponent */
e += 2;
}
- printf("Wrap\n");
+ fprintf(stderr, "Wrap\n");
}
STOP:
sem_post(&working);
@@ -296,11 +296,14 @@ main(int argc, char **argv) {
for (i = 0; i < thread_count; i++) {
khashes += khash_count[i];
}
- printf("Average rate: %.2f kH/s (%.2f kH/s/thread)\n",
+ fprintf(stderr, "Average rate: %.2f kH/s (%.2f kH/s/thread)\r",
(double)khashes / loops,
((double)khashes / loops) / thread_count);
}
+ /* line feed to finish off carriage return from hashrate fprintf */
+ fputc('\n', stderr);
+
for (i = 0; i < thread_count; i++) {
pthread_join(workers[i], NULL);
}