From fbd37c90a44cb70ed91f8a32302fc2f296a4a8d7 Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Fri, 23 Mar 2018 18:33:42 +0100 Subject: [PATCH] fix one off error in fudge library --- lib/dice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dice.c b/lib/dice.c index 3d4e0d7..7f34b3f 100644 --- a/lib/dice.c +++ b/lib/dice.c @@ -194,7 +194,7 @@ bool dice_get(dice_t d, dice_option_t opt, ...) static int dice_roll_fudge(void) { 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]; }