From 613c863f1d1433c1b7ff558409366fad1d9260b5 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Sun, 4 Sep 2022 18:10:40 +0200 Subject: [PATCH] Prepare an enum type to represent the final return codes --- include/types.h | 7 +++++++ src/hashcat.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/types.h b/include/types.h index f0beeabbb..aa577f2be 100644 --- a/include/types.h +++ b/include/types.h @@ -224,6 +224,13 @@ typedef enum status_rc } status_rc_t; +typedef enum rc_final +{ + RC_FINAL_OK = 0, + RC_FINAL_EXHAUSTED = 1 + +} rc_final_t; + typedef enum wl_mode { WL_MODE_NONE = 0, diff --git a/src/hashcat.c b/src/hashcat.c index 53619dca6..517fb5465 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1812,8 +1812,8 @@ int hashcat_session_execute (hashcat_ctx_t *hashcat_ctx) if (status_ctx->devices_status == STATUS_ABORTED_CHECKPOINT) rc_final = 3; if (status_ctx->devices_status == STATUS_ABORTED) rc_final = 2; if (status_ctx->devices_status == STATUS_QUIT) rc_final = 2; - if (status_ctx->devices_status == STATUS_EXHAUSTED) rc_final = 1; - if (status_ctx->devices_status == STATUS_CRACKED) rc_final = 0; + if (status_ctx->devices_status == STATUS_EXHAUSTED) rc_final = RC_FINAL_EXHAUSTED; + if (status_ctx->devices_status == STATUS_CRACKED) rc_final = RC_FINAL_OK; if (status_ctx->devices_status == STATUS_ERROR) rc_final = -1; } else if (rc_final == -1)