From 5e307603d6cbed5b68e6d9f27f15df248267b2e4 Mon Sep 17 00:00:00 2001 From: Chick3nman Date: Tue, 2 Apr 2019 16:06:18 -0500 Subject: [PATCH] Fix formatting --- src/terminal.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/terminal.c b/src/terminal.c index bf16f3c84..5cdfcd32a 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -922,15 +922,15 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx) end = time_now + sec_etc; } - printf ("\{ \"session\": \"%s\",", hashcat_status->session); + printf ("{ \"session\": \"%s\",", hashcat_status->session); printf (" \"status\": %d,", hashcat_status->status_number); printf (" \"target\": \"%s\",", hashcat_status->hash_target); - printf (" \"progress\": \[%" PRIu64 ", %" PRIu64 "\],", hashcat_status->progress_cur_relative_skip, hashcat_status->progress_end_relative_skip); + printf (" \"progress\": [%" PRIu64 ", %" PRIu64 "\],", hashcat_status->progress_cur_relative_skip, hashcat_status->progress_end_relative_skip); printf (" \"restore_point\": %" PRIu64 ",", hashcat_status->restore_point); - printf (" \"recovered_hashes\": \[%d, %d\],", hashcat_status->digests_done, hashcat_status->digests_cnt); - printf (" \"recovered_salts\": \[%d, %d\],", hashcat_status->salts_done, hashcat_status->salts_cnt); + printf (" \"recovered_hashes\": [%d, %d],", hashcat_status->digests_done, hashcat_status->digests_cnt); + printf (" \"recovered_salts\": [%d, %d],", hashcat_status->salts_done, hashcat_status->salts_cnt); printf (" \"rejected\": %" PRIu64 ",", hashcat_status->progress_rejected); - printf (" \"devices\": \["); + printf (" \"devices\": ["); for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { const device_info_t *device_info = hashcat_status->device_info_buf + device_id; @@ -942,7 +942,7 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx) { printf(","); } - printf (" \"device_id\": %d", device_id + 1); + printf (" { \"device_id\": %d", device_id + 1); printf (" \"speed\": %" PRIu64 ",", (u64) (device_info->hashes_msec_dev * 1000)); if (hwmon_ctx->enabled == true) @@ -956,9 +956,9 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx) printf (" \"util\": %d \}", util); } - printf (" \]"); + printf (" \],"); printf (" \"time_start\": %" PRIu64 ",", status_ctx->runtime_start); - printf (" \"estimated_stop\": %" PRIu64 " \}", end); + printf (" \"estimated_stop\": %" PRIu64 " }", end); hc_fwrite (EOL, strlen (EOL), 1, stdout); @@ -1666,7 +1666,7 @@ void status_speed_json (hashcat_ctx_t *hashcat_ctx) return; } - printf ("\{ \"devices\": ["); + printf ("{ \"devices\": ["); for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { @@ -1681,11 +1681,11 @@ void status_speed_json (hashcat_ctx_t *hashcat_ctx) printf(","); } - printf (" \{ \"device\": %d,", device_id + 1); - printf (" \"speed\": %" PRIu64 " \}", (u64) (device_info->hashes_msec_dev_benchmark * 1000)); + printf (" { \"device_id\": %d,", device_id + 1); + printf (" \"speed\": %" PRIu64 " }", (u64) (device_info->hashes_msec_dev_benchmark * 1000)); } - printf(" \] \}"); + printf(" ] }"); status_status_destroy (hashcat_ctx, hashcat_status); @@ -1789,7 +1789,7 @@ void status_progress_json (hashcat_ctx_t *hashcat_ctx) return; } - printf ("\{ \"devices\": ["); + printf ("{ \"devices\": ["); for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { @@ -1804,12 +1804,12 @@ void status_progress_json (hashcat_ctx_t *hashcat_ctx) printf(","); } - printf (" \{ \"device\": %d,", device_id + 1); + printf (" { \"device_id\": %d,", device_id + 1); printf (" \"progress\": %" PRIu64 ",", device_info->progress_dev); - printf (" \"runtime\": %0.2f \}", device_info->runtime_msec_dev); + printf (" \"runtime\": %0.2f }", device_info->runtime_msec_dev); } - printf(" \] \}"); + printf(" ] }"); status_status_destroy (hashcat_ctx, hashcat_status);