From 76f2278916ff8baec5f023e72237baca7e81f762 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 16 Dec 2015 01:24:46 +0100 Subject: fix issue #5 on github MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/string/strfry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/string/strfry.c b/src/string/strfry.c index ac8ef13..bced7ce 100644 --- a/src/string/strfry.c +++ b/src/string/strfry.c @@ -43,7 +43,7 @@ char* strfry(char* anagram) for (i = strlen(anagram); --i;) { r = rand(); - j = (size_t)((double)r / (RAND_MAX + 1) * (double)i); + j = (size_t)((double)r / ((double)RAND_MAX + 1) * (double)i); t = anagram[i], anagram[i] = anagram[j], anagram[j] = t; } return anagram; -- cgit v1.2.3-70-g09d2