From e0947dcc57b9d8ed97bb3a7daacbb9d46827786c Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Mon, 28 Jul 2014 17:25:37 +0000 Subject: [PATCH] Fix bug with 0 rand --- forftanks.c | 1 + 1 file changed, 1 insertion(+) diff --git a/forftanks.c b/forftanks.c index 24e62f9..96d00bc 100644 --- a/forftanks.c +++ b/forftanks.c @@ -175,6 +175,7 @@ forf_proc_random(struct forf_env *env) if (max < 1) { forf_push_num(env, 0); + return; } forf_push_num(env, rand() % max);