mirror of
https://github.com/hashcat/hashcat.git
synced 2025-02-16 17:42:04 +00:00
Fix a few warnings and divide by zero (speed_pos)
This commit is contained in:
parent
d656e9c3a4
commit
ce8f445ebe
@ -1975,6 +1975,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
|
||||
int hashconfig_init (hashcat_ctx_t *hashcat_ctx);
|
||||
void hashconfig_destroy (hashcat_ctx_t *hashcat_ctx);
|
||||
u32 hashconfig_forced_kernel_threads (hashcat_ctx_t *hashcat_ctx);
|
||||
u32 hashconfig_limited_kernel_threads (hashcat_ctx_t *hashcat_ctx, const hc_device_param_t *device_param);
|
||||
u32 hashconfig_get_kernel_threads (hashcat_ctx_t *hashcat_ctx, const hc_device_param_t *device_param);
|
||||
u32 hashconfig_get_kernel_loops (hashcat_ctx_t *hashcat_ctx);
|
||||
int hashconfig_general_defaults (hashcat_ctx_t *hashcat_ctx);
|
||||
|
@ -26032,8 +26032,6 @@ u32 hashconfig_limited_kernel_threads (hashcat_ctx_t *hashcat_ctx, const hc_devi
|
||||
|
||||
u32 hashconfig_get_kernel_threads (hashcat_ctx_t *hashcat_ctx, const hc_device_param_t *device_param)
|
||||
{
|
||||
const user_options_t *user_options = hashcat_ctx->user_options;
|
||||
|
||||
// a kernel can force a fixed value
|
||||
|
||||
const u32 forced_kernel_threads = hashconfig_forced_kernel_threads (hashcat_ctx);
|
||||
|
@ -1318,7 +1318,12 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param,
|
||||
|
||||
if (user_options->speed_only == true)
|
||||
{
|
||||
if (speed_msec > 4000) return -2; // special RC
|
||||
if (speed_msec > 4000)
|
||||
{
|
||||
device_param->speed_pos = 1;
|
||||
|
||||
return -2; // special RC
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1391,7 +1391,7 @@ double status_get_hashes_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int d
|
||||
{
|
||||
const u32 speed_pos = device_param->speed_pos;
|
||||
|
||||
for (int i = 0; i < speed_pos; i++)
|
||||
for (u32 i = 0; i < speed_pos; i++)
|
||||
{
|
||||
speed_cnt += device_param->speed_cnt[i];
|
||||
speed_msec += device_param->speed_msec[i];
|
||||
|
Loading…
Reference in New Issue
Block a user