Fixed a buffer overflow.

This commit is contained in:
2021-09-03 07:59:36 -07:00
parent 1938d44667
commit 282be95493
12 changed files with 104 additions and 103 deletions

View File

@ -42,7 +42,7 @@
* @param max Maximum value to generate to. (Exclusive)
* @return Random number between min and max.
*/
#define randRange(n, min, max) (mathMod(n, max - min) + min)
#define randRange(n, min, max) (mathMod(n, (max-min)) + min)
#define randInt32Range(min, max) randRange(randInt32(), min, max)
#define randFloatRange(min, max) (fmod(randFloat(), max- min) + min)