mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-22 14:48:12 +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:
parent
c100ad7be2
commit
d4a58b5fe5
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user