1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 08:08:10 +00:00

Fix get_random_num function to be inclusive of max parameter

The get_random_num function does not currently include the max parameter. This causes issues such as the tilde character not being generated with random rule generation. This makes the max parameter value inclusive.
This commit is contained in:
Flagg 2023-05-19 23:44:32 -04:00 committed by GitHub
parent c100ad7be2
commit d4a58b5fe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -622,11 +622,11 @@ u32 get_random_num (const u32 min, const u32 max)
#if defined (_WIN)
return (((u32) rand () % (max - min)) + min);
return (((u32) rand () % (max - min + 1)) + min);
#else
return (((u32) random () % (max - min)) + min);
return (((u32) random () % (max - min + 1)) + min);
#endif
}