1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-27 00:48:13 +00:00

Replace ctime with _r variant

This commit is contained in:
Rosen Penev 2016-12-02 21:32:18 -08:00
parent 5c0bd0a15f
commit 96591f3118
No known key found for this signature in database
GPG Key ID: 8B5A63249D3D4CE7
3 changed files with 11 additions and 4 deletions

View File

@ -17,6 +17,7 @@
#elif defined (_WIN32) || defined (_WIN64)
#define _WIN 1
#define WIN 1
#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L //for *time_r functions
#else
#error Your Operating System is not supported or detected
#endif

View File

@ -844,7 +844,9 @@ char *status_get_time_started_absolute (const hashcat_ctx_t *hashcat_ctx)
const time_t time_start = status_ctx->runtime_start;
char *start = ctime (&time_start);
char buf;
char *start = ctime_r (&time_start, &buf);
const size_t start_len = strlen (start);
@ -934,7 +936,9 @@ char *status_get_time_estimated_absolute (const hashcat_ctx_t *hashcat_ctx)
now += sec_etc;
char *etc = ctime (&now);
char buf;
char *etc = ctime_r (&now, &buf);
const size_t etc_len = strlen (etc);

View File

@ -70,8 +70,10 @@ void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const
if (user_options->show == true) return;
if (user_options->left == true) return;
event_log_info_nn (hashcat_ctx, "Started: %s", ctime (&proc_start));
event_log_info_nn (hashcat_ctx, "Stopped: %s", ctime (&proc_stop));
char start_buf, stop_buf;
event_log_info_nn (hashcat_ctx, "Started: %s", ctime_r (&proc_start, &start_buf));
event_log_info_nn (hashcat_ctx, "Stopped: %s", ctime_r (&proc_stop, &stop_buf));
}
int setup_console ()