1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-05-28 19:58:47 +00:00

Merge pull request #2106 from matrix/restore_1

(restore) remove unused *rc* vars and cleanup
This commit is contained in:
Jens Steube 2019-07-29 15:03:33 +02:00 committed by GitHub
commit 0718b87dcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,9 +180,7 @@ static int read_restore (hashcat_ctx_t *hashcat_ctx)
pidfile_ctx_destroy (hashcat_ctx); pidfile_ctx_destroy (hashcat_ctx);
const int rc_pidfile_init = pidfile_ctx_init (hashcat_ctx); if (pidfile_ctx_init (hashcat_ctx) == -1) return -1;
if (rc_pidfile_init == -1) return -1;
} }
return 0; return 0;
@ -254,9 +252,7 @@ int cycle_restore (hashcat_ctx_t *hashcat_ctx)
const char *eff_restore_file = restore_ctx->eff_restore_file; const char *eff_restore_file = restore_ctx->eff_restore_file;
const char *new_restore_file = restore_ctx->new_restore_file; const char *new_restore_file = restore_ctx->new_restore_file;
const int rc_write_restore = write_restore (hashcat_ctx); if (write_restore (hashcat_ctx) == -1) return -1;
if (rc_write_restore == -1) return -1;
if (hc_path_exist (eff_restore_file) == true) if (hc_path_exist (eff_restore_file) == true)
{ {
@ -332,17 +328,13 @@ int restore_ctx_init (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
restore_ctx->argc = argc; restore_ctx->argc = argc;
restore_ctx->argv = argv; restore_ctx->argv = argv;
const int rc_init_restore = init_restore (hashcat_ctx); if (init_restore (hashcat_ctx) == -1) return -1;
if (rc_init_restore == -1) return -1;
restore_ctx->enabled = true; restore_ctx->enabled = true;
if (user_options->restore == true) if (user_options->restore == true)
{ {
const int rc_read_restore = read_restore (hashcat_ctx); if (read_restore (hashcat_ctx) == -1) return -1;
if (rc_read_restore == -1) return -1;
restore_data_t *rd = restore_ctx->rd; restore_data_t *rd = restore_ctx->rd;
@ -355,9 +347,7 @@ int restore_ctx_init (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
user_options_init (hashcat_ctx); user_options_init (hashcat_ctx);
const int rc_options_getopt = user_options_getopt (hashcat_ctx, rd->argc, rd->argv); if (user_options_getopt (hashcat_ctx, rd->argc, rd->argv) == -1) return -1;
if (rc_options_getopt == -1) return -1;
} }
return 0; return 0;
@ -371,7 +361,6 @@ void restore_ctx_destroy (hashcat_ctx_t *hashcat_ctx)
hcfree (restore_ctx->eff_restore_file); hcfree (restore_ctx->eff_restore_file);
hcfree (restore_ctx->new_restore_file); hcfree (restore_ctx->new_restore_file);
hcfree (restore_ctx->rd); hcfree (restore_ctx->rd);
memset (restore_ctx, 0, sizeof (restore_ctx_t)); memset (restore_ctx, 0, sizeof (restore_ctx_t));