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.
pull/3736/head
Flagg 11 months ago committed by GitHub
parent c100ad7be2
commit d4a58b5fe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save