fix one off error in fudge library

This commit is contained in:
Florian Stinglmayr 2018-03-23 18:33:42 +01:00
parent 0e31b8fc1e
commit fbd37c90a4

View File

@ -194,7 +194,7 @@ bool dice_get(dice_t d, dice_option_t opt, ...)
static int dice_roll_fudge(void) static int dice_roll_fudge(void)
{ {
static int results[6] = {-1, -1, 0, 0, +1, +1}; static int results[6] = {-1, -1, 0, 0, +1, +1};
int idx = arc4random_uniform(sizeof(results)/sizeof(int)) + 1; int idx = arc4random_uniform(sizeof(results)/sizeof(int));
return results[idx]; return results[idx];
} }