mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-21 23:58:07 +00:00
Merge pull request #3736 from flaggx1/fix_get_random_num
Fix get_random_num function to be inclusive of max parameter
This commit is contained in:
commit
ba4ce96bbf
@ -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